- Premiere i gorro actius
- Canviat l'sprite de Premiere
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
o2aX = arcade_config.org2arc_escala
|
||||
cxr = arcade_config.character_per_row-1
|
||||
cxr2 = arcade_config.character_per_row_base2
|
||||
cw = arcade_config.character_width
|
||||
ch = arcade_config.character_height
|
||||
-- posició en el gif
|
||||
gorro_gif_col = 6
|
||||
gorro_gif_row = 2
|
||||
@@ -10,11 +5,14 @@ gorro_gif_row = 2
|
||||
gorro={name="gorro",hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
|
||||
|
||||
function gorro.init()
|
||||
local habs={{60,5},{4,5},{34,4},{62,7},{75,4}}
|
||||
local r=1+math.random(0,#habs-1)
|
||||
gorro.hab=habs[r][1]
|
||||
-- local habs={{60,5},{4,5},{34,4},{62,7},{75,4}}
|
||||
-- local r=1+math.random(0,#habs-1)
|
||||
-- gorro.hab=habs[r][1]
|
||||
-- gorro.x=habs[r][2]
|
||||
|
||||
-- gorro.x=habs[r][2]*8
|
||||
gorro.x=habs[r][2]
|
||||
gorro.hab=4
|
||||
gorro.x=5
|
||||
|
||||
local world_x, world_y = coords.room_to_world(gorro.hab,gorro.x,gorro.y)
|
||||
gorro.x=world_x
|
||||
@@ -24,28 +22,23 @@ function gorro.init()
|
||||
end
|
||||
|
||||
function gorro.draw()
|
||||
-- draw.surf(96,32,16,16,gorro.x,gorro.y,16,16)
|
||||
-- local x = gorro_gif_col*cw
|
||||
-- local y = gorro_gif_row*ch
|
||||
-- draw.surf(x,y,cw,ch,gorro.x*o2aX,gorro.y*o2aX,cw,ch)
|
||||
|
||||
local x = gorro_gif_col*cw
|
||||
local y = gorro_gif_row*ch
|
||||
local x = gorro_gif_col*gorro.w
|
||||
local y = gorro_gif_row*gorro.h
|
||||
local scr_x, scr_y = viewp:screen_coords( gorro.x, gorro.y )
|
||||
draw.surf(x,y,gorro.w,gorro.h,scr_x,scr_y,gorro.w,gorro.h)
|
||||
end
|
||||
|
||||
function gorro.update()
|
||||
-- if gorro.hab==abad.hab then
|
||||
-- if aabb(abad,gorro) then
|
||||
-- abad.objects.gorro=true
|
||||
-- if premiere.scene_intro then
|
||||
-- start_scene(scenes.gorro_trobat)
|
||||
-- else
|
||||
-- start_scene(scenes.gorro_trobat_nointro)
|
||||
-- end
|
||||
-- if abad.objects.gps~=nil then current_camera=3 end
|
||||
-- remove_actor(gorro)
|
||||
-- end
|
||||
-- end
|
||||
if gorro.hab==abad.hab then
|
||||
if collision(abad,gorro) then
|
||||
abad.objects.gorro=true
|
||||
if premiere.scene_intro then
|
||||
start_scene(scenes.gorro_trobat)
|
||||
else
|
||||
start_scene(scenes.gorro_trobat_nointro)
|
||||
end
|
||||
-- if abad.objects.gps~=nil then current_camera=3 end
|
||||
remove_actor(gorro)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user