Log In  

Cart #34115 | 2016-12-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


P#34108 2016-12-24 18:52 ( Edited 2016-12-26 15:38)

1

Not bad for a start, you got walls and all. However, the movement is a bit too qucik. There are workarounds for this. You could either add a value smaller than 1 (say, 0.1) when a player moves -- this will simply slow the movement down, or use btnp() rather than btn() -- this will ensure that a button has to either be repeatedly tapped or held down for a significant length of time for movement to happen.

P#34202 2016-12-26 05:15 ( Edited 2016-12-26 10:15)
1

I just came to say the same thing as tlm; nice start, just slow down movement.

One thing though, you're moving a cell at a time -- which is fine. But it also means you wouldn't want to change your speed to 0.1, etc., since it doesn't apply here. Instead, you should try implementing something like this:

  --[add to player's update code]
  cooldown -= 1
  if cooldown <= 0 then
    cooldown=0
  . . . 
  --[add to button handling code]
  if btn(0) and cooldown <= 0 then
    --
    --code to move player left goes here
    --
    cooldown=15 -- 15 frames, or ~0.5 seconds between moves if you're running at 30 fps
  end
P#34208 2016-12-26 10:38 ( Edited 2016-12-26 15:39)

[Please log in to post a comment]