Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Racing
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CWRules




PostPosted: 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.



Racing.zip
 Description:

Download
 Filename:  Racing.zip
 Filesize:  639.07 KB
 Downloaded:  519 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: 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
CWRules




PostPosted: 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.
darkangel




PostPosted: 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. Laughing 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




PostPosted: 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
Sniper4Life




PostPosted: 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....
CWRules




PostPosted: 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.
CWRules




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
yodu123




PostPosted: 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
leafs23




PostPosted: Wed May 13, 2009 7:51 am   Post subject: RE:Racing

make something easier!
yodu123




PostPosted: 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
McKenzie




PostPosted: 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.)
CWRules




PostPosted: 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.
saltpro15




PostPosted: 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
CWRules




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: