Compare commits
No commits in common. "5831cdf4e82c72f717a86a76ca7dc6bfeb827b05" and "b897f748be74add90c621f8de67fa9f786e3b46e" have entirely different histories.
5831cdf4e8
...
b897f748be
104
chameleonic.p8
104
chameleonic.p8
@ -207,7 +207,6 @@ function title:update()
|
||||
music(0)
|
||||
end
|
||||
end
|
||||
|
||||
-->8
|
||||
--level behaviors
|
||||
level={}
|
||||
@ -670,19 +669,19 @@ function player:update()
|
||||
if kbd:btn(0) then
|
||||
if level:can_move(true,self.x,self.y,-1,0,0,2) then
|
||||
self.todo=f4({{orientx=-1,orienty=0,px=-2},{px=-7},{x=self.x-1}})
|
||||
else wrongbleep:bleep() end
|
||||
end
|
||||
elseif kbd:btn(1) then
|
||||
if level:can_move(true,self.x,self.y,1,0,0,2) then
|
||||
self.todo=f4({{orientx=1,orienty=0,px=2},{px=7},{x=self.x+1}})
|
||||
else wrongbleep:bleep() end
|
||||
end
|
||||
elseif kbd:btn(2) then
|
||||
if level:can_move(true,self.x,self.y,0,-1,0,2) then
|
||||
self.todo=f4({{orienty=-1,py=-2},{py=-7},{y=self.y-1}})
|
||||
else wrongbleep:bleep() end
|
||||
end
|
||||
elseif kbd:btn(3) then
|
||||
if level:can_move(true,self.x,self.y,0,1,0,2) then
|
||||
self.todo=f4({{orienty=1,py=2},{py=7},{y=self.y+1}})
|
||||
else wrongbleep:bleep() end
|
||||
end
|
||||
elseif self.rope==nil and kbd:btnr(4) then
|
||||
local rx,ry,rx2,ry2=self:_rope_pos()
|
||||
local dx,dy=12*self.orientx,12*self.orienty
|
||||
@ -696,12 +695,13 @@ function player:update()
|
||||
}}
|
||||
elseif kbd:btnp(5) then
|
||||
if self.rope!=nil then
|
||||
if (not self.rope:tug()) wrongbleep:bleep(7)
|
||||
self.rope:tug()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self.rope) self.rope:prevent_highlight(#self.todo>0)
|
||||
_apply(self,self.todo)
|
||||
|
||||
if self.rope then
|
||||
@ -926,7 +926,7 @@ end
|
||||
|
||||
function rope:draw(artificial_dx,artificial_dy)
|
||||
local points,highlight=self:_tug(true)
|
||||
if (self:busy()) highlight=nil
|
||||
if (self:busy() or self._prevent_highlight) highlight=nil
|
||||
if (self.state.name=="done") return
|
||||
local perc_to_show=1.0
|
||||
if (self.state.name=="destroy") perc_to_show=(1.0-self.state.frame/5)^2
|
||||
@ -1433,9 +1433,17 @@ end
|
||||
function rope:tug()
|
||||
self:_tidy_up_gen()
|
||||
if (not self:latched()) return
|
||||
local rc=self:_tug()
|
||||
self:_tug()
|
||||
self:_tidy_up_gen()
|
||||
return rc
|
||||
end
|
||||
|
||||
function rope:prevent_highlight(prevent)
|
||||
if prevent then
|
||||
local points,highlight=self:_tug(true)
|
||||
if (self:busy() or highlight==nil) self._prevent_highlight=true
|
||||
else
|
||||
self._prevent_highlight=false
|
||||
end
|
||||
end
|
||||
|
||||
function rope:_tug(hypothetically)
|
||||
@ -1494,12 +1502,14 @@ function rope:_tug(hypothetically)
|
||||
for node=ancs[i-1].ix-1,ancs[i].ix+1 do
|
||||
local anc=self:_anc(node)
|
||||
end
|
||||
return true
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local latch=self.latch
|
||||
if latch!=nil and latch.el=="crate" then
|
||||
if (latch==nil) return ancs,nil
|
||||
|
||||
if latch.el=="crate" then
|
||||
local dmx,dmy=
|
||||
sgn0(latch.dx),
|
||||
sgn0(latch.dy)
|
||||
@ -1540,12 +1550,10 @@ function rope:_tug(hypothetically)
|
||||
)
|
||||
-- be busy for 4 ticks while the crate moves
|
||||
self:_anc(0).todo={{},{},{},{},{}}
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if (hypothetically) return ancs,nil
|
||||
return false
|
||||
return ancs,nil
|
||||
end
|
||||
|
||||
function rope:_calc_push(
|
||||
@ -1655,22 +1663,6 @@ function rope:_anchors_simplified()
|
||||
return points
|
||||
end
|
||||
|
||||
-->8
|
||||
--wrongbleeps
|
||||
wrongbleep={}
|
||||
add(real_modules,wrongbleep)
|
||||
function wrongbleep:init()
|
||||
self.duration=0
|
||||
end
|
||||
function wrongbleep:update()
|
||||
if (self.duration>5) self.duration=5
|
||||
if (self.duration>0) sfx(63,3)
|
||||
self.duration=max(self.duration-1,-2)
|
||||
end
|
||||
function wrongbleep:bleep(duration)
|
||||
self.duration+=duration or 2
|
||||
end
|
||||
|
||||
|
||||
__gfx__
|
||||
000030000000002200003000000cc0cc0cccccccccccccccccccccccccccccccc0bb0000000000000000000000000000dddddddd000000000005000000000000
|
||||
@ -1892,58 +1884,6 @@ __sfx__
|
||||
012800000000000000010550805501055080050105508055000550800000000070550005507055000550705500000000000105508055010550805501055080550005500000070550000000055000000705500000
|
||||
01280010183541a3541b3540000000000000002235400000213540000026354000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
01281000080050f005080550f05501055000000f055000000e3550000013355000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
010300000015000250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
__music__
|
||||
01 00014344
|
||||
00 02034344
|
||||
|
Loading…
Reference in New Issue
Block a user