Author |
Message |
CWRules
|
Posted: Wed Apr 29, 2009 7:26 pm Post subject: 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.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
Racing.zip |
Filesize: |
639.07 KB |
Downloaded: |
519 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Wed Apr 29, 2009 7:36 pm Post subject: 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
|
|
|
|
|
![](images/spacer.gif) |
CWRules
|
Posted: Thu Apr 30, 2009 4:36 pm Post subject: 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.
|
|
|
|
|
![](images/spacer.gif) |
darkangel
![](http://compsci.ca/v3/uploads/user_avatars/144136381845e745672f3dd.gif)
|
Posted: Mon May 04, 2009 9:15 pm Post subject: Re: Racing |
|
|
A very good game, I being a network guy would love to see a LAN multiplayer version of this. 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.
|
|
|
|
|
![](images/spacer.gif) |
yodu123
|
Posted: Sat May 09, 2009 10:13 pm Post subject: 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
|
|
|
|
|
![](images/spacer.gif) |
Sniper4Life
![](http://compsci.ca/v3/uploads/user_avatars/168469018949dab1f79d434.jpg)
|
Posted: Sat May 09, 2009 10:46 pm Post subject: 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....
|
|
|
|
|
![](images/spacer.gif) |
CWRules
|
Posted: Sun May 10, 2009 7:03 pm Post subject: 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.
|
|
|
|
|
![](images/spacer.gif) |
CWRules
|
Posted: Sun May 10, 2009 7:09 pm Post subject: 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.
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
yodu123
|
Posted: Tue May 12, 2009 8:56 pm Post subject: RE:Racing |
|
|
sorry guys for the begging i`ve major program due coming up and i`m just so worried
|
|
|
|
|
![](images/spacer.gif) |
leafs23
|
Posted: Wed May 13, 2009 7:51 am Post subject: RE:Racing |
|
|
make something easier!
|
|
|
|
|
![](images/spacer.gif) |
yodu123
|
Posted: Tue May 19, 2009 1:37 pm Post subject: RE:Racing |
|
|
how did u make the time to reset? i used time.elapsed but it is not that good
|
|
|
|
|
![](images/spacer.gif) |
McKenzie
![](http://www.wizards.com/global/images/swtcg_article_27_pic3_en.gif)
|
Posted: Tue May 19, 2009 4:02 pm Post subject: Re: Racing |
|
|
CWRules @ Sun May 10, 2009 7:09 pm wrote: 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.)
|
|
|
|
|
![](images/spacer.gif) |
CWRules
|
Posted: Wed May 20, 2009 2:58 pm Post subject: 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.
|
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
Posted: Wed May 20, 2009 5:10 pm Post subject: RE:Racing |
|
|
this is pretty awesome! is there any way I could see the source? I'm really interested in doing something like this
|
|
|
|
|
![](images/spacer.gif) |
CWRules
|
Posted: Thu May 21, 2009 9:13 pm Post subject: Re: Racing |
|
|
saltpro: See 7th post in this thread. I'm not doing all the work for you.
|
|
|
|
|
![](images/spacer.gif) |
|