Log In  

Cart #snake_afk-1 | 2019-11-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Did a really simple snake game during Saturday night :) haven't figured out how to properly increase the speed of the game so help with that and feedback is vert much appreciated.

Edit:

Added particles screen shake high score and difficulty selector

Cart #snake_afk-3 | 2019-11-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

P#69782 2019-11-10 18:45 ( Edited 2019-11-11 07:44)

if you want to increase the speed of your game you could use
function _update60()

instead of

function _update()

which will double your FPS if possible.
This would make your snake move even faster though and in my opinion it is way to fast already. I d suggest changing this part :

line:

0047 if snake.d == "�" then
0048      y += 1
0049  elseif snake.d == "�" then
0050      y -= 1
0051  elseif snake.d == "�" then
0052      x -= 1
0053  elseif snake.d == "�" then
0054      x += 1
0055  end

to x += 0.3 or similar values, 1 is just to much, it 30 pixels in one second and your pico 8 screen only has 128x128 pixels.

I like the switching colors! :) :)

P#69795 2019-11-11 02:27 ( Edited 2019-11-11 02:29)

I didn't explained myself sorry, I want it to increase the speed more smoothly currently if you change the "s" variable to 4 it's the "normal" speed or the initial speed the game should have, but the steps between speed 4 -> 1 is the thing that is causing me trouble. I move the snake 1 unit in the grid so the position always matches the grid and it doesn't end up on half a cell of the grid, I tried moving it a fraction of the cell and it felt really frustrating to play, so I think the solution is to only move certain frames, and that's the part I'm having problems with

Sorry if it's confusing.

P#69798 2019-11-11 05:35 ( Edited 2019-11-11 06:07)

Cart #snake_afk-2 | 2019-11-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Attempt to do the speed progression better and now it has a high score :)

P#69799 2019-11-11 06:05 ( Edited 2019-11-11 06:05)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:53:24 | 0.012s | Q:24