Angles, Dir_velocity and animposition

Learn how to make certain types of games and use gameEditor.

Angles, Dir_velocity and animposition

Postby Ehman » Sat Oct 06, 2018 11:32 pm

This is a car driving tutorial using the three main features above

Directional_velocity works with angles

Goal: Use <- & -> arrow key to turn car clockwise or anticlockwise
use /\ & \/ arrow key to accelerate and decelerate respectively.


Create your car(s) actor then load 8 multiple animation files ("anim00*x*.imgfile") rotated with 45° difference
In an create actor script: Change Anim direction"stopped"

In a key down script : left (right): Change Anim Dir "forward"("backward")
//Based on the degree difference between sprites

in a key down script up ( down) -> Script Editor:
Code: Select all
 directional_velocity =5; //for the brackets...
directional_velocity =-5; // They works with the direction of the angle


key up left or right: Change anim directioj "stopped"

Key up Up or down :
Code: Select all
directional_velocity =0;

in a draw actor script:
Code: Select all
angle = animpos * 45 // if animpos is 1 angle is 45 etc.


If you still don't get it here is a eemo \/
Attachments
Velocity_race.zip
See how it works!
(271.27 KiB) Downloaded 90 times
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest