Skip to content

Commit

Permalink
Add sprite image: Newer Koopa (57)
Browse files Browse the repository at this point in the history
Not too much different than Newer Goomba. Also made some improvements to
the regular Koopa code, while I was at it.
  • Loading branch information
RoadrunnerWMC committed Aug 1, 2014
1 parent ab3c9f0 commit a46c3d8
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 20 deletions.
43 changes: 43 additions & 0 deletions reggiedata/games/NewerSMBW/sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,48 @@ def loadImages():
SLib.loadIfNotInImageCache('FakeStarCoin', 'starcoin_fake.png')


class SpriteImage_NewerKoopa(SLib.SpriteImage_StaticMultiple): # 57
@staticmethod
def loadImages():
if 'KoopaG' in ImageCache: return
ImageCache['KoopaG'] = SLib.GetImg('koopa_green.png')
ImageCache['KoopaR'] = SLib.GetImg('koopa_red.png')
ImageCache['KoopaShellG'] = SLib.GetImg('koopa_green_shell.png')
ImageCache['KoopaShellR'] = SLib.GetImg('koopa_red_shell.png')
for flag in (0, 1):
for style in range(4):
ImageCache['Koopa%d%d' % (flag, style + 1)] = \
SLib.GetImg('koopa_%d%d.png'% (flag, style + 1))
if style < 3:
ImageCache['KoopaShell%d%d' % (flag, style + 1)] = \
SLib.GetImg('koopa_shell_%d%d.png'% (flag, style + 1))

def updateSize(self):
# get properties
props = self.parent.spritedata[5]
shell = (props >> 4) & 1
red = props & 1
texhack = (self.parent.spritedata[2] & 0xF) % 5

if not shell:

if texhack == 0:
self.offset = (-7, -15)
self.image = ImageCache['KoopaG'] if not red else ImageCache['KoopaR']
else:
self.offset = (-5, -13)
self.image = ImageCache['Koopa%d%d' % (red, texhack)]
else:
del self.offset

if texhack in (0, 4):
self.image = ImageCache['KoopaShellG'] if not red else ImageCache['KoopaShellR']
else:
self.image = ImageCache['KoopaShell%d%d' % (red, texhack)]

super().updateSize()


class SpriteImage_BigPumpkin(SLib.SpriteImage_StaticMultiple): # 157
def __init__(self, parent):
super().__init__(parent)
Expand Down Expand Up @@ -370,6 +412,7 @@ def loadImages():
20: SpriteImage_NewerGoomba,
22: SpriteImage_PumpkinGoomba,
49: SpriteImage_FakeStarCoin,
57: SpriteImage_NewerKoopa,
157: SpriteImage_BigPumpkin,
183: SpriteImage_Meteor,
188: SpriteImage_MidwayFlag,
Expand Down
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reggiedata/games/NewerSMBW/sprites/koopa_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 9 additions & 20 deletions sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -1424,37 +1424,26 @@ def loadImages():


class SpriteImage_KoopaTroopa(SLib.SpriteImage_StaticMultiple): # 57
def __init__(self, parent):
super().__init__(parent)
self.offset = (-7, -15)

@staticmethod
def loadImages():
SLib.loadIfNotInImageCache('KoopaG', 'koopa_green.png')
SLib.loadIfNotInImageCache('KoopaR', 'koopa_red.png')
SLib.loadIfNotInImageCache('KoopaShellG', 'koopa_green_shell.png')
SLib.loadIfNotInImageCache('KoopaShellR', 'koopa_red_shell.png')
if 'KoopaG' in ImageCache: return
ImageCache['KoopaG'] = SLib.GetImg('koopa_green.png')
ImageCache['KoopaR'] = SLib.GetImg('koopa_red.png')
ImageCache['KoopaShellG'] = SLib.GetImg('koopa_green_shell.png')
ImageCache['KoopaShellR'] = SLib.GetImg('koopa_red_shell.png')

def updateSize(self):
# get properties
props = self.parent.spritedata[5]
shell = (props >> 4) & 1
color = props & 1
red = props & 1

if shell == 0:
if not shell:
self.offset = (-7, -15)

if color == 0:
self.image = ImageCache['KoopaG']
else:
self.image = ImageCache['KoopaR']
self.image = ImageCache['KoopaG'] if not red else ImageCache['KoopaR']
else:
del self.offset

if color == 0:
self.image = ImageCache['KoopaShellG']
else:
self.image = ImageCache['KoopaShellR']
self.image = ImageCache['KoopaShellG'] if not red else ImageCache['KoopaR']

super().updateSize()

Expand Down

0 comments on commit a46c3d8

Please sign in to comment.