Log In  

Cart #picobike-0 | 2021-05-06 | Code ▽ | Embed ▽ | No License

any ideas or comments for improving the speed sensation?

P#91601 2021-05-06 20:44

:: merwok

It’s a good start! Two ideas that may or may not be good:

  • accelerate less so that there’s a longer build-up (current version changes too fast)
  • do some parallax scrolling for the background
P#91622 2021-05-07 03:02

Cart #picobike-1 | 2021-05-07 | Code ▽ | Embed ▽ | No License

I tried to add several parallax, in fact each dotted line between tracks, the result was weird.
I opted for a sinle parallax in front plan for now. I will for sure add some in the background when I'll finished those arts.
thanks!

-- remove some graphic glitch
-- add change of track

I still have a weird glitch when just pressing quiclky X and releasing, the bike seems to move then go backward. Have to fix this behaviour.

P#91652 2021-05-07 18:01 ( Edited 2021-05-07 18:02)
:: zlg

There's some jumpiness in the horizontal positioning of the barriers on the sides of the track. I'd take a look at your scrolling code to see if you're offsetting things at the right frame.

P#91694 2021-05-08 15:11

I updated the code in your cartridge to get rid of the jumpiness. I put a few notes about what I did in your code.
Basically , you were using t, which was tracking time, and multiplying it by the bike's speed to get a shifted position to draw your sprites. This caused jumpiness, because if you stopped moving then picked up again, the t value might be different. I simply changed it to make t adjusted only by the bike's speed.

I also changed the range of the mod function on t to 32 instead of 16. This is because you have the bottom row shifted left by 1.5 times the top row. Because of this, each time t%16 got to 15, the pixels were all shifted 24 pixels (24%16 = 8pixels) left, then when t%16 = 0, they jumped back to 0 shift. By changing it to scrl = t%32, it always loops smoothly. If you want to use other multiples, you just have to make sure that the mod you use, when multiplied by your chosen speeds, will result in multiples of 16 pixels.

top row:
16 x 1 = 16 - good
32 x 1 = 32 - good
bottom row
16 x 1.5 = 24 - bad
32 x 1.5 = 48 - good

example: if you wanted the bottom to scroll at 1.2 speed and the top at 1, you'd have to use mod 80.

Hope this helps.

Cart #picobike_adjusted-0 | 2021-05-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#91878 2021-05-13 07:03 ( Edited 2021-05-31 22:09)

you are awesome, I was really struggling to figure this out. Thanks for taking the time to explain it to me.

P#91891 2021-05-13 13:31

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-12-05 19:30:42 | 0.013s | Q:25