forked from pyrex/chameleonic
Compare commits
12 Commits
6be3fd51b0
...
rewrite_ro
Author | SHA1 | Date | |
---|---|---|---|
709be93332 | |||
535fcf7601 | |||
c98194550e | |||
c71cd312b1 | |||
ca819b0e53 | |||
281ed4b40f | |||
60f1c2e112 | |||
b0d356aeee | |||
6821d6cb53 | |||
675ef20115 | |||
a7b016c4b2 | |||
f3df6c674a |
@ -601,9 +601,6 @@ function level:can_move(
|
||||
if is_player and self:win_at(mx0+dmx,my0+dmy) then
|
||||
return true
|
||||
end
|
||||
if is_player and self:get_open_pit(mx0+dmx,my0+dmy) then
|
||||
return wrongbleep:adequately_warned()
|
||||
end
|
||||
|
||||
if self:mcoll(mx0+dmx,my0+dmy) then
|
||||
return false
|
||||
@ -771,7 +768,7 @@ function player:update()
|
||||
}}
|
||||
elseif kbd:btnp(5) then
|
||||
if self.rope!=nil then
|
||||
if (not self.rope:tug()) wrongbleep:bleep(9)
|
||||
if (not self.rope:tug()) wrongbleep:bleep(7)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -815,9 +812,8 @@ function player:_fall()
|
||||
end
|
||||
|
||||
function player:draw()
|
||||
local px=self.x*8+self.px+wrongbleep:vibrate()
|
||||
local py=self.y*8+self.py+wrongbleep:vibrate()
|
||||
|
||||
local px=self.x*8+self.px
|
||||
local py=self.y*8+self.py
|
||||
|
||||
local head=1-self.orienty
|
||||
|
||||
@ -915,7 +911,7 @@ function rope:update()
|
||||
if (self.state.frame>=3) self.state={name="latched"}
|
||||
|
||||
elseif self.state.name=="latched" then
|
||||
if (self.latch==nil) wrongbleep:bleep(5) self:destroy() return
|
||||
if (self.latch==nil) wrongbleep:bleep(3) self:destroy() return
|
||||
|
||||
if
|
||||
self.latch!=nil and
|
||||
@ -1602,24 +1598,15 @@ wrongbleep={}
|
||||
add(real_modules,wrongbleep)
|
||||
function wrongbleep:init()
|
||||
self.duration=0
|
||||
self.continuous=0
|
||||
end
|
||||
function wrongbleep:update()
|
||||
if (self.duration>5) self.duration=5
|
||||
if self.duration>0 then sfx(63,3) self.continuous+=1
|
||||
else self.continuous=0 end
|
||||
self.duration=max(self.duration-1,-4)
|
||||
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
|
||||
function wrongbleep:vibrate(duration)
|
||||
if (self.continuous<10) return 0
|
||||
return (rnd()*2-1)*min(self.continuous/10,2)
|
||||
end
|
||||
function wrongbleep:adequately_warned(duration)
|
||||
return self.continuous>45
|
||||
end
|
||||
|
||||
|
||||
__gfx__
|
||||
|
Reference in New Issue
Block a user