【GameMaker】Torpedo

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

motion_set(0,2);//start moving
Step Event:
execute code:

if (keyboard_check(vk_left))  {direction+=2;} //rotate left
if (keyboard_check(vk_right))  {direction-=2;} //rotate right
if (keyboard_check(vk_up))  {speed+=1;} //increasespeed
image_angle=direction;//point in direction moving
if speed>3 speed=3;//cap speed
if speed>2 speed-=0.1;//cap boost speed
Collision Event with object obj_wall:
execute code:

show_message("You Die");
game_restart();
Collision Event with object obj_target:
execute code:

show_message("You Win");
game_restart();

No comments:

This will make you a better decision maker | Annie Duke (author of “Thinking in Bets” and “Quit”, former pro poker…

Annie is a former professional poker player, decision-making expert, author, and special partner at First Round Capital.  ͏     ­͏     ­͏   ...

Contact Form

Name

Email *

Message *