Skip to content

Commit

Permalink
Merge pull request #24 from cameron-teed/master
Browse files Browse the repository at this point in the history
added sprites and worked on the slpash screens
  • Loading branch information
Mr-Coxall authored Jan 9, 2020
2 parents 05ec9b9 + 349ae77 commit 81720d1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 28 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# ICS3U-2019-Group20
# ICS3U-2019-Group20
Cameron Teed and RJ Fromm
Binary file added SPRITES.bmp
Binary file not shown.
81 changes: 54 additions & 27 deletions code.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,13 @@ def mt_splash_scene():

# used this program to split the iamge into tile: https://ezgif.com/sprite-cutter/ezgif-5-818cdbcc3f66.png
background.tile(2, 2, 0) # blank white
background.tile(3, 2, 1)
background.tile(4, 2, 2)
background.tile(5, 2, 3)
background.tile(6, 2, 4)
background.tile(3, 2, 0)
background.tile(4, 2, 0)
background.tile(5, 2, 0)
background.tile(6, 2, 0)
background.tile(7, 2, 0) # blank white

background.tile(2, 3, 0) # blank white
background.tile(3, 3, 5)
background.tile(4, 3, 6)
background.tile(5, 3, 7)
background.tile(6, 3, 8)
background.tile(7, 3, 0) # blank white

background.tile(2, 4, 0) # blank white
background.tile(3, 4, 9)
background.tile(4, 4, 10)
background.tile(5, 4, 11)
background.tile(6, 4, 12)
background.tile(7, 4, 0) # blank white

background.tile(2, 5, 0) # blank white
background.tile(3, 5, 0)
background.tile(4, 5, 13)
background.tile(5, 5, 14)
background.tile(6, 5, 0)
background.tile(7, 5, 0) # blank white


text = []

Expand Down Expand Up @@ -238,9 +219,55 @@ def game_splash_scene():


def main_menu_scene():
# this function is the game scene
# this function is the Main menu

# an image bank for CircuitPython
image_bank_3 = stage.Bank.from_bmp16("tree.bmp")

# sets the background to image 0 in the bank
background = stage.Grid(image_bank_3, constants.SCREEN_GRID_X, constants.SCREEN_GRID_Y)

# used this program to split the iamge into tile: https://ezgif.com/sprite-cutter/ezgif-5-818cdbcc3f66.png
top_right_of_tree = stage.Sprite(image_bank_3 0, 16, 0)
sprites.append(top_right_of_tree)
top_middle_of_tree = stage.Sprite(image_bank_3 1, 16, 16)
sprites.append(top_middle_of_tree)
top_of_tree = stage.Sprite(image_bank_3 2, 16, 32)
sprites.append(top_of_tree)
top_left_of_tree = stage.Sprite(image_bank_3 3, 32, 0)
sprites.append(top_left_of_tree)
middle_right_of_tree = stage.Sprite(image_bank_3 4, 32, 16)
sprites.append(middle_right_of_tree)
middle_of_tree = stage.Sprite(image_bank_3 5, 32, 32)
sprites.append(middle_of_tree)
middle_left_of_tree = stage.Sprite(image_bank_3 6, 48, 0)
sprites.append(middle_left_of_tree)
bottem_right_of_tree = stage.Sprite(image_bank_3 7, 48, 16)
sprites.append(bottem_right_of_tree)
bottem_midle_of_tree = stage.Sprite(image_bank_3 8, 48, 32)
sprites.append(bottem_midle_of_tree)
bottem_left_of_tree = stage.Sprite(image_bank_3 9, 64, 0)
sprites.append(bottem_left_of_tree)
verybottem_right_of_tree = stage.Sprite(image_bank_3 10, 64, 16)
sprites.append(verybottem_right_of_tree)
verybottem_middle_of_tree = stage.Sprite(image_bank_3 11, 64, 32)
sprites.append(verybottem_middle_of_tree)
verybottem_left_of_tree = stage.Sprite(image_bank_3 12, 16, 0)
sprites.append(verybottem_left_of_tree)
final_of_tree = stage.Sprite(image_bank_3 13, 16, 0)
sprites.append(final_of_tree)


# create a stage for the background to show up on
# and set the frame rate to 60fps
game = stage.Stage(ugame.display, 60)
# set the layers, items show up in order
game.layers = sprites + [background]
# render the background and inital location of sprite list
# most likely you will only render background once per scene
game.render_block()


# repeat forever, game loop
while True:
# get user input

Expand Down Expand Up @@ -277,4 +304,4 @@ def game_over_scene(final_score):


if __name__ == "__main__":
blank_white_reset_scene()
blank_white_reset_scene()
Binary file added squish.wav
Binary file not shown.
Binary file added swords.wav
Binary file not shown.
Binary file added tree.bmp
Binary file not shown.

0 comments on commit 81720d1

Please sign in to comment.