Skip to content

Commit 8265bf7

Browse files
committed
Removed "pixeltiles"
1 parent 70b30e1 commit 8265bf7

16 files changed

+50
-202
lines changed

animation.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ function animation:update(dt)
872872
transformenemyanimation(v[2])
873873
elseif v[1] == "killallenemies" then
874874
for i2, v2 in pairs(objects) do
875-
if i1 ~= "tile" and i2 ~= "pixeltile" and i2 ~= "buttonblock" then
875+
if i1 ~= "tile" and i2 ~= "buttonblock" then
876876
for i, v in pairs(objects[i2]) do
877877
if v.active and v.shotted and (not v.resistseverything) then
878878
local dir = "right"

box.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ function box:floorcollide(a, b)
296296
end
297297
end
298298

299-
if a == "pixeltile" and (self.t == "edgeless" or self.gel == 2) then
299+
if b.SLOPE and (self.t == "edgeless" or self.gel == 2) then
300300
if b.dir == "left" then
301-
self.speedx = self.speedx - 6000*b.step*gdt
301+
self.speedx = self.speedx - 32*b.incline*gdt
302302
else
303-
self.speedx = self.speedx + 6000*b.step*gdt
303+
self.speedx = self.speedx + 32*b.incline*gdt
304304
end
305305
end
306306

enemies/bigmole.lua

+6-12
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ function bigmole:init(x, y)
4444
self.shot = false
4545
self.trackplatform = true
4646

47+
self.oldx = self.x
48+
self.oldy = self.y
49+
4750
self.checktable = {"player","box"} --CARRY PLAYER
4851
end
4952

@@ -55,7 +58,7 @@ function bigmole:update(dt)
5558
if inrange(w.x, self.x-w.width, self.x+self.width) then
5659
if w.y+w.height >= self.y-(1/16) and w.y+w.height <= self.y+(4/16) and (not w.jumping) then
5760
if not checkintile(w.x+self.speedx*dt, w.y, w.width, w.height, tileentities, w, "ignoreplatforms") then
58-
w.x = w.x + self.speedx*dt
61+
w.x = w.x + (self.x-self.oldx)
5962
w.y = math.min(self.y-w.height, w.y)
6063
w.falling = false
6164
w.falloverridestrict = 2
@@ -67,6 +70,8 @@ function bigmole:update(dt)
6770
end
6871
end
6972
end
73+
self.oldx = self.x
74+
self.oldy = self.y
7075
--rotate back to 0 (portals)
7176
self.rotation = math.fmod(self.rotation, math.pi*2)
7277
if self.rotation > 0 then
@@ -167,12 +172,6 @@ function bigmole:leftcollide(a, b)
167172
if self:globalcollide(a, b) then
168173
return false
169174
end
170-
171-
if a == "pixeltile" and b.dir == "right" then
172-
self.y = self.y - 1/16
173-
return false
174-
end
175-
176175
self.speedx = goombaspeed
177176

178177
self.animationdirection = "left"
@@ -185,11 +184,6 @@ function bigmole:rightcollide(a, b)
185184
return false
186185
end
187186

188-
if a == "pixeltile" and b.dir == "left" then
189-
self.y = self.y - 1/16
190-
return false
191-
end
192-
193187
self.speedx = -goombaspeed
194188

195189
self.animationdirection = "right"

enemies/boomboom.lua

-10
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,6 @@ function boomboom:leftcollide(a, b)
468468
if self:globalcollide(a, b) then
469469
return false
470470
end
471-
472-
if a == "pixeltile" and b.dir == "right" then
473-
self.y = self.y - 1/16
474-
return false
475-
end
476471

477472
if self.direction == "left" and not self.bigjumping and not self.smalljumping and not self.ducking and b.y > self.y and self.speedy == 0 then
478473
self:smalljump()
@@ -491,11 +486,6 @@ function boomboom:rightcollide(a, b)
491486
if self:globalcollide(a, b) then
492487
return false
493488
end
494-
495-
if a == "pixeltile" and b.dir == "left" then
496-
self.y = self.y - 1/16
497-
return false
498-
end
499489

500490
if self.direction == "right" and not self.bigjumping and not self.smalljumping and not self.ducking and b.y > self.y and self.speedy == 0 then
501491
self:smalljump()

enemies/goomba.lua

+1-20
Original file line numberDiff line numberDiff line change
@@ -885,11 +885,6 @@ function goomba:leftcollide(a, b, passive)
885885
return false
886886
end
887887

888-
if a == "pixeltile" and b.dir == "right" then
889-
self.y = self.y - b.step
890-
return false
891-
end
892-
893888
if self.t == "spiketop" and (a == "tile" or a == "buttonblock" or a == "flipblock" or a == "frozencoin") then
894889
if self.animationdirection == "right" then
895890
self.speedy = -goombaspeed
@@ -937,10 +932,6 @@ function goomba:rightcollide(a, b)
937932
return false
938933
end
939934

940-
if a == "pixeltile" and b.dir == "left" then
941-
self.y = self.y - b.step
942-
return false
943-
end
944935
if self.t == "spiketop" and (a == "tile" or a == "buttonblock" or a == "flipblock" or a == "frozencoin") then
945936
if self.animationdirection == "right" then
946937
self.speedy = goombaspeed
@@ -1025,7 +1016,7 @@ function goomba:globalcollide(a, b)
10251016
return true
10261017
end
10271018

1028-
if self.t == "spiketop" and a == "pixeltile" then
1019+
if self.t == "spiketop" and b.SLOPE then --TODO: Fix spiketops with slopes
10291020
return true
10301021
end
10311022

@@ -1173,16 +1164,6 @@ function goomba:passivecollide(a, b)
11731164
if self:globalcollide(a, b) then
11741165
return false
11751166
end
1176-
if a == "pixeltile" then
1177-
local x, y = b.cox, b.coy
1178-
if tilequads[map[x][y][1]].platform then
1179-
return false
1180-
elseif self.y+self.width <= b.y+b.step then
1181-
self.y = self.y - b.step
1182-
return true
1183-
end
1184-
return false
1185-
end
11861167
self:leftcollide(a, b, "passive")
11871168
return false
11881169
end

enemies/hammerbro.lua

-6
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,6 @@ function hammerbro:leftcollide(a, b)
331331
self:shotted()
332332
elseif a == "boomerang" and b.killstuff then
333333
self:shotted()
334-
elseif a == "pixeltile" and b.dir == "right" then
335-
self.y = self.y - 1/16
336-
return false
337334
end
338335

339336
return false
@@ -361,9 +358,6 @@ function hammerbro:rightcollide(a, b)
361358
self:shotted()
362359
elseif a == "boomerang" and b.killstuff then
363360
self:shotted()
364-
elseif a == "pixeltile" and b.dir == "left" then
365-
self.y = self.y - 1/16
366-
return false
367361
end
368362

369363
return false

enemies/koopa.lua

-47
Original file line numberDiff line numberDiff line change
@@ -646,25 +646,11 @@ function koopa:leftcollide(a, b, passive)
646646
if self:globalcollide(a, b) then
647647
return false
648648
end
649-
if a == "tile" then--check for jump through blocks
650-
local x, y = b.cox, b.coy
651-
652-
--slant
653-
if self.onslant == "right" and self.y+self.height-2/16 <= b.y then
654-
self.y = b.y-self.height
655-
return false
656-
end
657-
end
658649

659650
if self:hitwall(a, b, "left") then
660651
return false
661652
end
662653

663-
if a == "pixeltile" and b.dir == "right" and (not (self.t == "flying")) and (not (self.t == "flying2")) and self.y < b.y then
664-
self.y = self.y - b.step
665-
return false
666-
end
667-
668654
self:hitenemy(a, b, "left")
669655

670656
if self.small == false and not self.frozen then
@@ -681,25 +667,11 @@ function koopa:rightcollide(a, b)
681667
if self:globalcollide(a, b) then
682668
return false
683669
end
684-
if a == "tile" then--check for jump through blocks
685-
local x, y = b.cox, b.coy
686-
687-
--slant
688-
if self.onslant == "left" and self.y+self.height-2/16 <= b.y then
689-
self.y = b.y-self.height
690-
return false
691-
end
692-
end
693670

694671
if self:hitwall(a, b, "right") then
695672
return false
696673
end
697674

698-
if a == "pixeltile" and b.dir == "left" and (not (self.t == "flying")) and (not (self.t == "flying2")) and self.y < b.y then
699-
self.y = self.y - b.step
700-
return false
701-
end
702-
703675
self:hitenemy(a, b, "right")
704676

705677
if self.small == false and not self.frozen then
@@ -794,16 +766,6 @@ function koopa:hitenemy(a, b, dir)
794766
end
795767

796768
function koopa:passivecollide(a, b)
797-
if a == "pixeltile" then
798-
local x, y = b.cox, b.coy
799-
if tilequads[map[x][y][1]].platform then
800-
return false
801-
elseif self.y+self.width >= b.y+b.step and b.dir == self.slant then
802-
self.y = self.y - b.step
803-
return true
804-
end
805-
return false
806-
end
807769
if a ~= "clearpipesegment" then
808770
if self.speedx < 0 then
809771
self:leftcollide(a, b, "passive")
@@ -869,15 +831,6 @@ function koopa:floorcollide(a, b)
869831
self.speedy = -koopajumpforce
870832
end
871833
end
872-
873-
--slants/slopes
874-
local onslant = (a == "pixeltile")
875-
if onslant then
876-
self.onslant = b.dir
877-
self.onslantstep = b.step
878-
else
879-
self.onslant = false
880-
end
881834
end
882835

883836
function koopa:ceilcollide(a, b)

enemies/spike.lua

+3-23
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,6 @@ function spike:leftcollide(a, b)
298298
if self:globalcollide(a, b) then
299299
return false
300300
end
301-
if a == "pixeltile" and b.dir == "right" then
302-
self.y = self.y - 1/16
303-
return false
304-
end
305301
if not self.spit then
306302
self.speedx = spikespeed
307303
self.animationdirection = "left"
@@ -314,10 +310,6 @@ function spike:rightcollide(a, b)
314310
if self:globalcollide(a, b) then
315311
return false
316312
end
317-
if a == "pixeltile" and b.dir == "left" then
318-
self.y = self.y - 1/16
319-
return false
320-
end
321313
if not self.spit then
322314
self.speedx = -spikespeed
323315
self.animationdirection = "right"
@@ -572,10 +564,6 @@ function spikeball:leftcollide(a, b)
572564
if self:globalcollide(a, b) then
573565
return false
574566
end
575-
if a == "pixeltile" and b.dir == "right" then
576-
self.y = self.y - b.step
577-
return false
578-
end
579567
if a == "tile" and self.t == "spike" then
580568
local ti = 1
581569
if ismaptile(b.cox, b.coy) and map[b.cox][b.coy][1] then
@@ -616,10 +604,6 @@ function spikeball:rightcollide(a, b)
616604
if self:globalcollide(a, b) then
617605
return false
618606
end
619-
if a == "pixeltile" and b.dir == "left" then
620-
self.y = self.y - b.step
621-
return false
622-
end
623607
if a == "tile" and self.t == "spike" then
624608
local ti = 1
625609
if ismaptile(b.cox, b.coy) and map[b.cox][b.coy][1] then
@@ -691,11 +675,11 @@ function spikeball:floorcollide(a, b)
691675
return false
692676
end
693677
if self.rolling then
694-
if a == "pixeltile" then
678+
if b.SLOPE then
695679
if b.dir == "left" then
696-
self.speedx = self.speedx - 1500*b.step*gdt
680+
self.speedx = self.speedx - 16*b.incline*gdt
697681
else
698-
self.speedx = self.speedx + 1500*b.step*gdt
682+
self.speedx = self.speedx + 16*b.incline*gdt
699683
end
700684
end
701685
end
@@ -727,10 +711,6 @@ function spikeball:passivecollide(a, b)
727711
if a == "player" then
728712
return false
729713
end
730-
if a == "pixeltile" then
731-
self.y = self.y - b.step
732-
return false
733-
end
734714
if a == "tile" and self.t == "spike" then
735715
local ti = 1
736716
if ismaptile(b.cox, b.coy) and map[b.cox][b.coy][1] then

enemies/splunkin.lua

-10
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,6 @@ function splunkin:leftcollide(a, b)
209209
return false
210210
end
211211

212-
if a == "pixeltile" and b.dir == "right" then
213-
self.y = self.y - 1/16
214-
return false
215-
end
216-
217212
if self.fast == false then
218213
self.speedx = 2
219214
else
@@ -228,11 +223,6 @@ function splunkin:rightcollide(a, b)
228223
return false
229224
end
230225

231-
if a == "pixeltile" and b.dir == "left" then
232-
self.y = self.y - 1/16
233-
return false
234-
end
235-
236226
if self.fast == false then
237227
self.speedx = -2
238228
else

0 commit comments

Comments
 (0)