Discuss Scratch

galaxybubbles35
New Scratcher
1 post

I need help adding checkpoints to my platformer game.

I've watched a few tutorials, but they don't show how to make checkpoints for platformer games. I've tried to work it out on my own, but I can't figure out how I'm going to put the code together.

Here's the link to my game: https://scratch.mit.edu/projects/508804141/fullscreen/

bluedragon8633
Scratcher
1000+ posts

I need help adding checkpoints to my platformer game.

Assuming you're using a level variable, it should be pretty easy:
Simplest way: Checkpoints every five levels
repeatuntillevel/5=flooroflevel/5changelevelby-1

Let me know if you need customizable spawning locations.
-Mysticoder-
Scratcher
100+ posts

I need help adding checkpoints to my platformer game.

Hi, the best way is for the player to instead of going to a certain x or y, go to spawn x and spawn y, that will allow you to edit the spawn point rather easily.
Binary-Logic
Scratcher
100+ posts

I need help adding checkpoints to my platformer game.

If it's a scrolling platformer, try this:
iftouchingPlayer?thendelete1ofcheckpointsdelete1ofcheckpointsaddscrollxtocheckpointsaddscrollytocheckpointsiftouchingdanger?thensetscroll xtoitem1ofcheckpointssetscroll ytoitem2ofcheckpoints

Did that help?
A-A-R-C
Scratcher
14 posts

I need help adding checkpoints to my platformer game.

so basicly make a sprite that is the check point add a code so it is effected by your scroll engine then
the player sprite
whenclickedforeveriftouching checkpoint sprite?thenbroadcast checkpoint activate

checkpoint sprite
whenIreceive checkpoint activate
Then change level

Hope this helps
bluedragon8633
Scratcher
1000+ posts

I need help adding checkpoints to my platformer game.

A-A-R-C wrote:

so basicly make a sprite that is the check point add a code so it is effected by your scroll engine then
the player sprite
Hopethishelps:D/quoteThatonlyworksifthere'sonlyonecheckpoint.Asystemwithincrementalcheckpoints,meaningoneevery5levelsorsomething,ismoreefficient.Andthere'snoscrollingintheproject.
A-A-R-C
Scratcher
14 posts

I need help adding checkpoints to my platformer game.

okay

Powered by DjangoBB