Skip to content

Commit

Permalink
make pudgi's sleep and update angel spritesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kcunningham20 committed May 8, 2018
1 parent f384597 commit df5de45
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 1,448 deletions.

Large diffs are not rendered by default.

Binary file removed sprites/spritesheets/sleeping_angel_pudgi (1).png
Binary file not shown.
Binary file added sprites/spritesheets/sleeping_angel_pudgi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion virtupet/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion virtupet/Pudgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __init__(self, parents=None, load_file=None):
self.weights = {}
self.sprite_sheet_l = None
self.sprite_sheet_r = None
self.sprite_sheet_s = None

self.handler = JSONHandler()

Expand Down Expand Up @@ -70,6 +71,9 @@ def __init__(self, parents=None, load_file=None):

self.walking_frames_l = []
self.walking_frames_r = []
self.walking_frames_s = []
# load z's animation
self.walking_frames_z = []

self.current_frame = 0
self.len_animation = None
Expand Down Expand Up @@ -152,6 +156,7 @@ def decode_color(self, chromosomes):
# set sprite sheets from dna
self.sprite_sheet_l = SpriteSheet(node["L"])
self.sprite_sheet_r = SpriteSheet(node["R"])
self.sprite_sheet_s = SpriteSheet(node["S"])

# set color from dna
self.color = node["Color"]
Expand Down Expand Up @@ -248,15 +253,30 @@ def load_animations(self):
image = self.sprite_sheet_l.get_image(x, y, 138, 114)
self.walking_frames_l.append(image)

# load sleeping animation
sprite_count = 0
for y in range(0, 828):
if sprite_count == 60:
break
for x in range(0, 912):
if x % 138 == 0 and y % 114 == 0:
if sprite_count == 60:
break
sprite_count += 1
image = self.sprite_sheet_s.get_image(x, y, 138, 114)
self.walking_frames_s.append(image)

self.len_animation = sprite_count

def update(self):
self.rect.x += self.change_x

if self.direction == "R":
self.image = self.walking_frames_r[self.current_frame]
else:
elif self.direction == "L":
self.image = self.walking_frames_l[self.current_frame]
elif self.direction == "S":
self.image = self.walking_frames_s[self.current_frame]
self.current_frame += 1

if self.current_frame >= self.len_animation:
Expand Down
Binary file added virtupet/assets/sleeping_angel_pudgi.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 virtupet/assets/sleeping_blue_pudgi.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 virtupet/assets/sleeping_green_pudgi.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 virtupet/assets/sleeping_midnight_pudgi.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 virtupet/assets/sleeping_purple_pudgi.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 virtupet/assets/sleeping_red_pudgi.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 virtupet/assets/sleeping_vampire_pudgi.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 virtupet/assets/sleeping_white_pudgi.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 virtupet/assets/sleeping_z.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions virtupet/data/color_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,29 @@
"0": {
"Color": "Vampire",
"L": "./assets/pudgi-vampire-l.png",
"R": "./assets/pudgi-vampire-r.png"
"R": "./assets/pudgi-vampire-r.png",
"S": "./assets/sleeping_vampire_pudgi.png"
},
"1": {
"Color": "Midnight",
"L": "./assets/pudgi-midnight-l.png",
"R": "./assets/pudgi-midnight-r.png"
"R": "./assets/pudgi-midnight-r.png",
"S": "./assets/sleeping_midnight_pudgi.png"
}
},
"1": {
"0": {
"Color": "Purple",
"L": "./assets/pudgi-purple-l.png",
"R": "./assets/pudgi-purple-r.png"
"R": "./assets/pudgi-purple-r.png",
"S": "./assets/sleeping_purple_pudgi.png"

},
"1": {
"Color": "Blue",
"L": "./assets/pudgi-blue-l.png",
"R": "./assets/pudgi-blue-r.png"
"R": "./assets/pudgi-blue-r.png",
"S": "./assets/sleeping_blue_pudgi.png"
}
}
},
Expand All @@ -31,23 +36,27 @@
"0": {
"Color": "Red",
"L": "./assets/pudgi-red-l.png",
"R": "./assets/pudgi-red-r.png"
"R": "./assets/pudgi-red-r.png",
"S": "./assets/sleeping_red_pudgi.png"
}, "1": {
"Color": "Green",
"L": "./assets/pudgi-green-l.png",
"R": "./assets/pudgi-green-r.png"
"R": "./assets/pudgi-green-r.png",
"S": "./assets/sleeping_green_pudgi.png"
}
},
"1": {
"0": {
"Color": "White",
"L": "./assets/pudgi-white-l.png",
"R": "./assets/pudgi-white-r.png"
"R": "./assets/pudgi-white-r.png",
"S": "./assets/sleeping_white_pudgi.png"
},
"1": {
"Color": "Angel",
"L": "./assets/pudgi-angel-l.png",
"R": "./assets/pudgi-angel-r.png"
"R": "./assets/pudgi-angel-r.png",
"S": "./assets/sleeping_angel_pudgi.png"
}
}
}
Expand Down
155 changes: 0 additions & 155 deletions virtupet/data/pudgies/0x103e8.json

This file was deleted.

Loading

0 comments on commit df5de45

Please sign in to comment.