Sprite: spr_ball
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent: obj_parent
Children:
Mask:
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code: motion_set(random(360),2);
Step Event:
execute code: inst=instance_nearest(x,y,obj_player);//get id of nearest player if (keyboard_check(ord('A'))) {inst.x-=5;} //make inst move if (keyboard_check(ord('D'))) {inst.x+=5;} if (keyboard_check(ord('W'))) {inst.y-=5;} if (keyboard_check(ord('S'))) {inst.y+=5;}
Collision Event with object obj_border:
execute code: hspeed*=-1; vspeed*=-1;
Collision Event with object obj_player:
execute code: hspeed*=-1; vspeed*=-1;
No comments:
Post a Comment