Sprites and tiles

This commit is contained in:
MaddoScientisto 2024-04-15 00:06:10 +02:00
commit e50d1ca2a1
2 changed files with 36 additions and 29 deletions

View file

@ -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