
-----------------------------------
CWRules
Wed Apr 29, 2009 7:26 pm

Racing
-----------------------------------
This is the racing engine I plan to use in my next game. Any and all suggestions are welcome. Controls are in the game, I recommend 100 for all stats at first.

Thanks to drij, this is derived from his 'Car' program.

-----------------------------------
Homer_simpson
Wed Apr 29, 2009 7:36 pm

Re: Racing
-----------------------------------
its nice
some sound would be nice
also there's just a little glitch if u collide with the wall at slow speeds you get stuck.
it looks good tho i'de like to see it finished

-----------------------------------
CWRules
Thu Apr 30, 2009 4:36 pm

Re: Racing
-----------------------------------
I don't have much experience with sound yet, but I will add it later.

I couldn't find a way around the stuck-on-walls glitch, that's what the reset button is for.

-----------------------------------
darkangel
Mon May 04, 2009 9:15 pm

Re: Racing
-----------------------------------
A very good game, I being a network guy would love to see a LAN multiplayer version of this.  :lol:  Thou I  have to admit, I'm not sure what grade your in, but using whatdotcolor isn't the best way to be doing your collision, and that might actually be your problem for getting stuck in the walls. There must be some good tuts for this kind of collison. If not I'll post a copy.

-----------------------------------
yodu123
Sat May 09, 2009 10:13 pm

RE:Racing
-----------------------------------
hey i`m doing kind of same thing for a school product but i don`t even know where to start can you give me some tips? pls pls pls

-----------------------------------
Sniper4Life
Sat May 09, 2009 10:46 pm

RE:Racing
-----------------------------------
yodu123...
plz...dont be a begger..-_-

like you can ask for some tips but seriously...dont start with the "PLZPLZPLZPLZPLZ"...it annoys people....

-----------------------------------
CWRules
Sun May 10, 2009 7:03 pm

Re: Racing
-----------------------------------
Sorry for the delay, I didn't think I'd get any more posts.

To answer your qestions:

darkangel: I'm in grade 10, and I'll look into other forms of colliosion detection.

yodu123: http://compsci.ca/v3/viewtopic.php?t=19641&highlight=car+automobile
               That's what I started from. Hope it helps.
               And yeah, don't beg like that. It's creepy.

-----------------------------------
CWRules
Sun May 10, 2009 7:09 pm

Re: Racing
-----------------------------------
Hmm. Not sure a different form of collision detection would help. My method is to mulitply velocity by -0.8 if you hit a wall or barrier. If you can suggest improvements, please do.

P.S. Technically you can't get stuck in a wall, the car just drives backwards and really slowly.

-----------------------------------
yodu123
Tue May 12, 2009 8:56 pm

RE:Racing
-----------------------------------
sorry guys for the begging i`ve major program due coming up  and i`m just so worried

-----------------------------------
leafs23
Wed May 13, 2009 7:51 am

RE:Racing
-----------------------------------
make something easier!

-----------------------------------
yodu123
Tue May 19, 2009 1:37 pm

RE:Racing
-----------------------------------
how did u make the time to reset? i used time.elapsed but it is not that good

-----------------------------------
McKenzie
Tue May 19, 2009 4:02 pm

Re: Racing
-----------------------------------
Hmm. Not sure a different form of collision detection would help. My method is to mulitply velocity by -0.8 if you hit a wall or barrier. If you can suggest improvements, please do.

P.S. Technically you can't get stuck in a wall, the car just drives backwards and really slowly.

OK, I didn't look at your code, or run it so my advice my be off-base, but this is a common problem. Your collision only detects a hit when the car is "in" the wall. If multiply the velocity by -0.8 the car might not have enough velocity to escape the wall. Before you multiply the velocity you need to extract the car from the wall. A simple way is to simply subtract the velocity from the position (to backtrack one frame.)

-----------------------------------
CWRules
Wed May 20, 2009 2:58 pm

Re: Racing
-----------------------------------
Not a bad idea. I probably should have thought of that...

Anyway, to answer yodu's question: Are you using the system clock to judge time? I tried that at first, but when I ran the game on a slow computer the game slowed down but the time didn't. So now I just add to the time every frame. This makes the clock slow down with everything else.

I you insist on using the system clock, just create a variable called start_time or something like that and set it whenever you start a race. Subtract start_time from current time to find time passed.

-----------------------------------
saltpro15
Wed May 20, 2009 5:10 pm

RE:Racing
-----------------------------------
this is pretty awesome!  is there any way I could see the source? I'm really interested in doing something like this

-----------------------------------
CWRules
Thu May 21, 2009 9:13 pm

Re: Racing
-----------------------------------
saltpro: See 7th post in this thread. I'm not doing all the work for you.

-----------------------------------
leafs23
Fri May 22, 2009 7:20 am

RE:Racing
-----------------------------------
awesome game foo

-----------------------------------
saltpro15
Fri May 22, 2009 3:53 pm

RE:Racing
-----------------------------------
ah, my mistake.  thanks
