- Reestructuració
This commit is contained in:
31
data/gps.lua
Normal file
31
data/gps.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
gps={hab=5,x=48,y=24,bb={x=0,y=0,w=8,h=8}}
|
||||
|
||||
function gps.init()
|
||||
local habs={{33,8},{13,4},{51,9},{50,4},{42,7}}
|
||||
local r=1+rnd(#habs)
|
||||
gps.hab=habs[r][1]
|
||||
gps.x=habs[r][2]*8
|
||||
gps.update=gps.update
|
||||
gps.draw=gps.draw
|
||||
end
|
||||
|
||||
function gps.draw()
|
||||
sspr(112,48,16,16,gps.x,gps.y,16,16)
|
||||
end
|
||||
|
||||
function gps.update()
|
||||
if gps.hab==abad.hab then
|
||||
if aabb(abad,gps) then
|
||||
abad.objects.gps=true
|
||||
if abad.objects.gorro==nil then
|
||||
current_camera=1
|
||||
elseif abad.objects.peu==nil then
|
||||
current_camera=2
|
||||
else
|
||||
current_camera=3
|
||||
end
|
||||
remove_actor(gps)
|
||||
start_scene(scenes.gps_trobat)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user