aboutsummaryrefslogtreecommitdiff
path: root/build/Debug/Pico-Lua-Test.app/Contents/Resources/shot.lua
blob: 7a63b9f81cac0742c1bfb9e70621e05fb6aa7e5a (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
34
35
--the directions
up=0
right=1
down=2
left = 3

--parameters
this.actorname = "Bullet: Normal"
this.enemy = 0
this.speed = 6
this.controllable = 0

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