Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Post by substitute541 »

This page is under construction. This is not a game yet, it's just a test

Hi I'm substitute541(obviously) and I'm going to show you my (under construction) 2 player racing game. Currently, it has a test background image (I got it from dropbox's pictures)

Progress : 45% completed.

Downloads :
Turnspeed fix. This has the turnspeed fix, credits to micha. Drag and drop the game.lua and main.lua to the game.

2PR Test V1. This is the first version.

Screenshots :
Image
A note on the gif quality : Slow net, and trying to save my Dropbox space.

You are free to check the code out. I didn't optimize the code (especially in game.lua) so it has lots of lines.
Last edited by substitute541 on Sun Oct 14, 2012 7:50 am, edited 2 times in total.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Post by T-Bone »

It works! And bonus points to you for not using vsync :neko:
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Post by micha »

Hi, very nice. I like it. Especially that you already included a menu.

One advice for the driving physics: At the moment the cars are turning with a constant speed when I press left or right. This is good, because it means, if I go fast, the car drives in a large bend, while the bend is smaller, if I drive slowly. On the other hand that way I can steer while standing. And also the steering is reversed when the car goes backwards.

Here is my suggestion to fix this:
1) To determine the angular velocity (the amount the car rotates in one frame) multiply some constant number with the car's speed (instead of using a constant only).
Instead of

Code: Select all

p1car.radians = p1car.radians - 3 * dt
try this:

Code: Select all

angularVelocity = p1car.speed * 3 
p1car.radians = p1car.radians - angularVelocity * dt
Of course the number 3 has to be changed to an appropriate value.
2) Then you will have the problem that the car turns with a constant bend radius, independently of the cars speed. To avoid that, now add the following:

Code: Select all

angularVelocity = math.min(p1car.speed * 3, 3) 
p1car.radians = p1car.radians - angularVelocity * dt
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Post by substitute541 »

micha wrote:Hi, very nice. I like it. Especially that you already included a menu.

One advice for the driving physics: At the moment the cars are turning with a constant speed when I press left or right. This is good, because it means, if I go fast, the car drives in a large bend, while the bend is smaller, if I drive slowly. On the other hand that way I can steer while standing. And also the steering is reversed when the car goes backwards.

Here is my suggestion to fix this:
1) To determine the angular velocity (the amount the car rotates in one frame) multiply some constant number with the car's speed (instead of using a constant only).
Instead of

Code: Select all

p1car.radians = p1car.radians - 3 * dt
try this:

Code: Select all

angularVelocity = p1car.speed * 3 
p1car.radians = p1car.radians - angularVelocity * dt
Of course the number 3 has to be changed to an appropriate value.
2) Then you will have the problem that the car turns with a constant bend radius, independently of the cars speed. To avoid that, now add the following:

Code: Select all

angularVelocity = math.min(p1car.speed * 3, 3) 
p1car.radians = p1car.radians - angularVelocity * dt
Um yeah, I tried to do different techniques to make it more realistic, then I gived up saying "This makes the game hard". I haven't thought of that yet, maybe I'll try (in my way).
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: Sub's Two Player Racing Demos [UNDER CONSTRUCTION]

Post by qaisjp »

substitute541 wrote:then I gived up saying
1. never give up
2. "then I gave up saying"
3. looks nice, looking forward to something with this.
Lua is not an acronym.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests