mirror of
https://gitlab.com/MaddoScientisto/cirnofarm.git
synced 2026-06-06 05:45:55 +00:00
Sprites and tiles
This commit is contained in:
parent
302e7f4289
commit
e50d1ca2a1
2 changed files with 36 additions and 29 deletions
|
|
@ -1,4 +1,4 @@
|
|||
--[[pod_format="raw",created="2024-04-14 14:05:11",modified="2024-04-14 21:05:28",revision=66]]
|
||||
--[[pod_format="raw",created="2024-04-14 14:05:11",modified="2024-04-14 22:05:51",revision=77]]
|
||||
mouse_debug = true
|
||||
w=480
|
||||
h=300
|
||||
|
|
@ -7,12 +7,12 @@ function _init()
|
|||
add(player, {
|
||||
x=128,
|
||||
y=128,
|
||||
speed=2,
|
||||
speed=1.2,
|
||||
hflip=false,
|
||||
spriteIndex=64,
|
||||
move_x=0,
|
||||
move_y=0,
|
||||
cm=true, -- Collide with map tiles
|
||||
cm=false, -- Collide with map tiles
|
||||
cb=true, -- Collide with world bounds
|
||||
draw=function(self)
|
||||
spr(self.spriteIndex,self.x,self.y, self.hflip)
|
||||
|
|
@ -20,11 +20,11 @@ function _init()
|
|||
if (mouse_debug == true) then
|
||||
local col = 8;
|
||||
if (checkCollision(self.move_x,self.move_y) == true) then col = 7 end
|
||||
pset(self.move_x,self.move_y,col)
|
||||
--pset(self.move_x,self.move_y,col)
|
||||
end
|
||||
|
||||
end,
|
||||
update=function(self)
|
||||
update=function(self)
|
||||
self.move_x = self.x
|
||||
self.move_y = self.y
|
||||
if (btn(0)) self.move_x -= self.speed self.hflip = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue