ludum-dare-22/objects/obj_player/Step_0.gml

119 lines
2.7 KiB
Plaintext
Raw Normal View History

global.timeout -= 1
global.invuln -= 1
switch global.keyconfig
{
case 0: //standard
case 1: //QWERTZ
up = keyboard_check(ord("W"));
down = keyboard_check(ord("S"));
right = keyboard_check(ord("D"));
left = keyboard_check(ord("A"));
break;
case 2: //AZERTY
up = keyboard_check(ord("Z"));
down = keyboard_check(ord("S"));
right = keyboard_check(ord("D"));
left = keyboard_check(ord("Q"));
break;
case 3: //Dvorak
up = keyboard_check(ord(","));
down = keyboard_check(ord("O"));
right = keyboard_check(ord("E"));
left = keyboard_check(ord("A"));
break;
default:
break;
}
if right
direction = 180
if up
direction = -90
if left
direction = 0
if down
direction = -270
if up and right
direction = -135
if up and left
direction = -45
if down and left
direction = 45
if down and right
direction = 135
if chargeup < 1
chargeup += .2
if up or down or left or right
speed = 15 * chargeup
else
chargeup = 0
repeat (3)
{
instance_create(x-5+random(10),y-5+random(10),obj_star)
}
if global.scores > 150000*global.limit
{
global.limit = 2*global.limit
global.lives += 1
global.extend = 20
sound_play(snd_extend)
}
if global.invuln < 1
{
hit = instance_nearest(x,y,obj_spinner)
if distance_to_object(hit) < 16 and hit.active = 1
{
with (hit)
instance_destroy()
instance_destroy()
}
hit = instance_nearest(x,y,obj_meteorlarge)
if distance_to_object(hit) < 32 and hit.active = 1
{
with (hit)
instance_destroy()
instance_destroy()
}
hit = instance_nearest(x,y,obj_meteormed)
if distance_to_object(hit) < 16 and hit.active = 1
{
with (hit)
instance_destroy()
instance_destroy()
}
hit = instance_nearest(x,y,obj_meteorsmall)
if distance_to_object(hit) < 8 and hit.active = 1
{
with (hit)
instance_destroy()
instance_destroy()
}
hit = instance_nearest(x,y,obj_boss1)
if distance_to_object(hit) < 64 and hit.active = 1
{
with (hit)
instance_destroy()
instance_destroy()
}
hit = instance_nearest(x,y,obj_bees)
if distance_to_object(hit) < 8 and hit.active = 1
{
with (hit)
instance_destroy()
instance_destroy()
}
hit = instance_nearest(x,y,obj_boss1bullet)
if distance_to_object(hit) < 4
{
with (hit)
instance_destroy()
instance_destroy()
}
}