Add basic motor sound
This commit is contained in:
15
racing.p8
15
racing.p8
@ -44,11 +44,8 @@ function car:update()
|
||||
end
|
||||
if btn(⬅️) then self.x=self.x-1 end
|
||||
if btn(➡️) then self.x=self.x+1 end
|
||||
if btn(⬅️) or btn(➡️) then
|
||||
sfx(1,10,-1,0,5)
|
||||
else
|
||||
sfx(1,8,-1,0,5)
|
||||
end
|
||||
sfx(-1)
|
||||
sfx(self.speed)
|
||||
end
|
||||
|
||||
function car:draw()
|
||||
@ -57,7 +54,6 @@ function car:draw()
|
||||
tick=self.game.t\(2^(4-self.speed))%4
|
||||
end
|
||||
palt(0x0100)
|
||||
printh(1+tick*2)
|
||||
spr(1+tick*2,self.x,self.y,2,2)
|
||||
print("speed:"..car.speed,5,5,5)
|
||||
end
|
||||
@ -123,7 +119,6 @@ function road:draw()
|
||||
else
|
||||
end
|
||||
else
|
||||
printh("y:"..y.." self:"..self[y+1])
|
||||
if x<self[y+1] then
|
||||
sprite=49
|
||||
elseif x==self[y+1] then
|
||||
@ -317,3 +312,9 @@ __label__
|
||||
82228222828282228888822282228222828882228882822288888888888888888888888888888888888888888882822288828288822282228882822288822288
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
|
||||
__sfx__
|
||||
0001000c0105003050040500405004050010500005000050020500005000050000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0001000c0405004050030500205003050040500605007050060500405006050060500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0001000c0505005050080500805006050070500a0500a050080500705009050090500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0001000c0a0500b0500905007050090500b0500a050080500a0500b050090500c0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0101000c0d0500c0500b0500b0500c0500d0500a0500a0500d0500c0500b0500b0500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
Reference in New Issue
Block a user