aboutsummaryrefslogtreecommitdiff
path: root/scripts/shot.lua
blob: 3077f087f0997e2da24bd6c4f38496932ce32fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--parameters
this.actorname = "Bullet: Normal"
this.enemy			= enemy_weapon
this.speed			= 6
this.controllable	= false
this.physics		= false

this:load_clip("./sfx/shot.wav");
this:play_sfx("./sfx/shot.wav");

print(">>> Entity Created - "..this.actorname);

function this.move(this)

	if(this:get_currentdirection() == right) then
		this:set_ownspeed(this.speed)
	end
	
	if (this:get_currentdirection() == left) then
		this:set_ownspeed(-this.speed)
	end

	if ( not this:can_move(left, this:get_x(), this:get_y()) or
		 not this:can_move(right, this:get_x(), this:get_y())) then
		this:set_dying(true)
	end
end

function this.act(this)
	this:move()
end

--END