You are browsing as a guest. Sign up (or log in) to start making projects!

39m 12s logged

so I just quickly made the coin script(copy and pasted the bomb script and only changed the signal to collected, so it adds coins instead of stopping the game) and player script:
_physics_process reads your input every frame and moves the player by changing its position. arrow keys/WASD give a direction, and it moves at speed in that direction.
there’s a clamp so you can’t leave the screen — it keeps the player’s x and y inside the screen bounds so you can’t wander off the edges.
in _ready it adds itself to the “player” group - that’s the tag the coins and bombs check for when something touches them. so this one line is what makes the player actually recognizable as “the player” to everything else.
it doesn’t handle score or game-over at all, it just moves and stays on screen.

so now, the player can move!

0
1

Comments 0

No comments yet. Be the first!