Does GE have this feature?

Game Editor comments and discussion.

Does GE have this feature?

Postby jb15 » Thu Feb 10, 2011 8:55 pm

I'm trying to make a car go around a path. I have two questions:

1. Is there a way I can make the car rotate automatically, to make it look like it's actually driving around the track?

2. Is there a way I can control the speed? (For example, connect the path speed to "carspeed" variable. When key space is down, make "carspeed" = "carspeed" + 1. When key b is down, make "carspeed" = "carspeed" - 1).

Is this doable?
Attachments
1.ged
(2.15 KiB) Downloaded 73 times
jb15
 
Posts: 4
Joined: Thu Feb 10, 2011 7:54 pm
Score: 0 Give a positive score

Re: Does GE have this feature?

Postby Hblade » Fri Feb 11, 2011 1:51 pm

No, GE does not support rotation by coding, however you can have your car rotate animatedly with 359 animation frames, then have your movement xvelocity and yvelocity based on the angle. For example:

animpos=angle;




When turning the car, do something like this:
angle++;



Now for the movement code:
Code: Select all
directional_velocity=5;



This will make him move 5 pixels per frame in the angle the car is in. I could give a full detailed example if you want.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Does GE have this feature?

Postby jb15 » Fri Feb 11, 2011 9:57 pm

I'd really appreciate an example file! I'm brand new to GE, and don't really know what I'm doing... :)
jb15
 
Posts: 4
Joined: Thu Feb 10, 2011 7:54 pm
Score: 0 Give a positive score

Re: Does GE have this feature?

Postby Hblade » Sat Feb 12, 2011 8:05 pm

Well see the thing is I don't have GE currently installed on this comp :( Hmm try this: make the car rotate with 24 frames

Now for the angle control

Code: Select all
angle=animpos*24;


then, on KeyDown (The go button)

Code: Select all
directional_velocity=5;


That should do it xD Oh, and if the car goes backwards, then try changing the angle code to this:
Code: Select all
angle=-animpos*24;
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Does GE have this feature?

Postby jb15 » Wed Feb 16, 2011 2:58 am

Thanks for the reply. It's not working for me, though. (By that I mean I see no difference between before and after I coded). The car still just faces the right constantly. Any tips? Help?
jb15
 
Posts: 4
Joined: Thu Feb 10, 2011 7:54 pm
Score: 0 Give a positive score

Re: Does GE have this feature?

Postby schnellboot » Wed Feb 16, 2011 8:04 am

hm.. do you have the rotating animation?
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Does GE have this feature?

Postby jb15 » Wed Feb 16, 2011 3:41 pm

I don't really know what you mean... Do you mean I need to make separate animations, with the car facing the different directions? I that's what you mean, how would I do that? Are there any tools that could speed up the process?
jb15
 
Posts: 4
Joined: Thu Feb 10, 2011 7:54 pm
Score: 0 Give a positive score

Re: Does GE have this feature?

Postby schnellboot » Wed Feb 16, 2011 3:49 pm

yes you do
http://game-editor.com/forum/viewtopic.php?f=1&t=9418&p=65783
this is what you need thanks to DST
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron