obj_player
create event:
spawn_id = 0
step event:
inst = instance_place(x,y,obj_spawn_point)
if inst//create/update spawn point
{
spawn_id = inst
}
if (keyboard_check(ord('T')))//move to last spawn point
{
x=spawn_id.x;
y=spawn_id.y;
}
//movement code
if (keyboard_check(ord('A'))) {x-=5;}
if (keyboard_check(ord('D'))) {x+=5;}
if (keyboard_check(ord('W'))) {y-=5;}
if (keyboard_check(ord('S'))) {y+=5;}
obj_enemy
step event:
x++
Search thousands of free JavaScript snippets that you can quickly copy and paste into your web pages. Get free JavaScript tutorials, references, code, menus, calendars, popup windows, games, and much more.
Subscribe to:
Post Comments (Atom)
The Win Machine
The Road to Hell is Paved with Intervention ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ...
-
code.gs // 1. Enter sheet name where data is to be written below var SHEET_NAME = "Sheet1" ; // 2. Run > setup // // 3....
No comments:
Post a Comment