making a Car actor like oldschool games ( like gta advance )

Learn how to start making games.

making a Car actor like oldschool games ( like gta advance )

Postby tdmxross » Wed Apr 18, 2018 4:47 am

I want to make a car actor which can be controlled using W-A-S-D keys. let me explain the concept-
1. We use A and D to change the angle of the car actor, as well as it updates the animation of the car to face in the current angle.
2. W key makes the car actor move in the angle the car is facing. ( car actors directional velocity increases as the W key is held down and when the velocity reaches a certain amount, it cannot go further more. thus limiting cars speed )
3. S key is like brake for the car actor. when we press S key, the velocity of the car decreases and stops the car completely when reaches zero velocity.
4. collision. i want the car actor to stop completely ( zero velocity ) when it crashes ( collision at high velocity )on walls/objects etc.

Now the glitches,
1. the car will change it's angle even when not in motion ( at zero velocity ), and as the scripts, it will still update car actors animation when the A and D keys are pressed. and i don't want that to happen. i want the car actor to update the animation ONLY when it is in motion.
2.if the car crashes on the walls, as i mentioned above, i want it to stop completely. but, it should not happen when the car has low value velocity. ( no crash when the speed is low )

That's all! if anyone can explain me how to make this happen, please do! :D :D
GE is better than every single game engine
User avatar
tdmxross
 
Posts: 48
Joined: Sun Dec 24, 2017 7:12 pm
Location: Maharashtra, India
Score: 4 Give a positive score

Re: making a Car actor like oldschool games ( like gta advan

Postby lcl » Wed Apr 18, 2018 8:54 pm

Glitch number 1:
Couldn't you just put the animation updating codes inside if statements checking if directional_velocity > 0?
Code: Select all
if (directional_velocity > 0)
{
    // update animation
}


Glitch number 2:
Well, what is it then that you want the car to do if colliding at a wall with a low velocity?
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: making a Car actor like oldschool games ( like gta advan

Postby tdmxross » Tue Apr 24, 2018 6:08 am

thank you for replying. i have solved the issues. check out the attachment and let me know if i done the work right! :D
Attachments
Car demo.rar
(148.78 KiB) Downloaded 139 times
GE is better than every single game engine
User avatar
tdmxross
 
Posts: 48
Joined: Sun Dec 24, 2017 7:12 pm
Location: Maharashtra, India
Score: 4 Give a positive score


Return to Getting Started

Who is online

Users browsing this forum: No registered users and 1 guest