@BGelais I intend the comments lower down for those people finding this game a little too tricky (as I do). Your game looks good and plays decently within its design choice as a linear racer etc, but I'm not a frequent player of racing games and perhaps because of this I crash very quickly now it has been increased to 60fps.
I have poked into the code briefly - it's very readable and easy to work with; so thank you for that! - and below I provide two tweaks to affect the feel of the game should anyone want them (note to others - BGelais' cart is under the license: CC4-BY-NC-SA) or if you wanted to implement them yourself (but perhaps in a better-than-I've-written-them, adjustable-in-game way, such as easy mode (perhaps with less points for passing cars), and normal mode).
By the way @BGelais I think you have a typo on your menu screen, where it reads "crivals".
Thank you for the game. :)
As I always write at length, I've hidden some of the longer sections.
@Vinnyc11 a quick glance at the code makes their movement look random.
Rival's code and a tweak
From tab 5 (--rivals & stufs)
if o.spr==7 or o.spr==39 then local d=flr(rnd(50)) if (d==1) o.xd=-.3 if (d==2) o.xd=.3 if (d==3) o.xd=0 if (d==4 and o.spr==39) o.xd=0 end
If someone wanted to download it and make it easier for themself, the d==1 and d==2 lines could have lower numbers:
if (d==1) o.xd=-.15 if (d==2) o.xd=.15
What I find difficult is the responsiveness of the car speed.
In tab 1 (player):
--if (btn(⬆️)) pl.sp+=0.1 --if (btn(⬇️)) pl.sp-=0.2
pl.sp is then multiplied by 50 to give the player feedback on the speed; tab 4 (draws)
Analysis of player speed
Presuming I have understood the code correctly with my glance, at 60 frames per second, with a maximum speed of 5, which we get to in 0.1 increments, then we go from 0 to full speed in 5/6ths of a second.
Braking is twice as effective, so when you try to slow to avoid the random x movement of the yellow and red cars, you slow down to nothing in 5/12ths of a second.
I don't have the reactions of a racing driver (0.2 seconds according to racing-elite.com), but I suspect that screen size, button/finger responsiveness, and cramped fingers using the cursor keys for both lateral and speed control also contribute to my many crashes. (I'm going to try out other controls for the version I have downloaded.) When I do catch up to the other cars and try to slow myself - just enough to not crash into them, but not so much as to lose them - the braking is always too much. And if I have overtaken some cars and brake a little too much, a yellow or red car inevitably slams into the back of me.
Perhaps I'm over-reacting in how long I press the decelerate button, whereas perhaps frequent players of racing games have a far finer gradation of control that their fingers exert. I'm not a frequent player of racing games. Anyway, for anyone looking for more gradation of control at higher speeds ...
Tweak to player's code
In tab 1 (player) find player_update and change these two lines:
if (btn(⬆️)) pl.sp+=0.1 if (btn(⬇️)) pl.sp-=0.2
To something like:
local spi,spd,spden=0.05,0.1,1 if (pl.sp>190) spden=((250-190)/3) spi/=spden spd/=spden if (btn(⬆️)) pl.sp+=spi if (btn(⬇️)) pl.sp-=spd
This should allow more control at speeds around 200, which I believe is about what the rival cars are driving at. Note, my code change here isn't designed to be realistic.
Disclaimer: My look into the code really was brief; it might be that other factors also contribute to either the movement of rivals or the player speed.
fantastic look and feel to this one! your game has that nice mix of tight controls and tension that classic racers evoke.
i think scoring is bugged though (at least for me). for some reason when i am passing a bunch of cars (right about when i get to a score of 130-155) the score stops increasing. then when i finally crash, the score increases a bit for cars passing my fiery wreckage. once i start again the score starts increasing again, but only for a short while before it stops once more. maybe it is because i hug the rails so to speak? i am not sure.
other than that, i really like this one. i appreciate you sharing your game with all of us! thank you.
@anydayhappyday Thanks a lot! Yes the scoring problem is due to the speed you pass the cars avoiding quickly this condition in the code... if someone got a better solution to fix that, welcome.
if o.y>106 and o.y<108 then if (o.spr==7) score+=20 if (o.spr==23) score+=5 if (o.spr==39) score+=10 end
By the way, short time after I wrote this, i finally fixed the score bug!! Version 10 ;)
[Please log in to post a comment]