【GameMaker】 Top Down Racing

Information about object: obj_wall
Sprite: spr_wall
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object

Information about object: obj_car
Sprite: spr_car
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Step Event:
execute code:


if (keyboard_check(vk_left))  {image_angle+=2;} //rotate
if (keyboard_check(vk_right))  {image_angle-=2;} 
if (keyboard_check(vk_up))  {speed+=0.5} //accelerate
if speed>5 speed=5;//cap speed
speed=speed*0.98;//add friction
direction=image_angle;//move in direction car is pointing
if place_meeting(x,y,obj_wall)
{
speed*=-1;
}
if abs(speed)<0.1 speed=0;




Information about object: obj_room
Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

view_enabled[0] = true;
view_visible[0] = true;
view_wview[0]=800;
view_hview[0]=800;

view_object[0]=obj_car;//set object to follow
view_hborder[0] = view_wview[0] / 2;
view_vborder[0] = view_hview[0] / 2;

No comments:

Top 3 UX Design Articles of 2024 to Remember

Based on most subscriptions ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­...

Contact Form

Name

Email *

Message *