Rocket Shoot Game by Python Turtle Graphic.
This Project is created to satisfy creator demand. When I was little I'm the fan of 'platypus' the game that airplane firing enemy to earn score. So I decide to do this style of game by my own style to become 'Rocket Shoot Game'
Player is play as a aircraft, is allow to move up, down, forward, backward and shoot by keyboard pressing w,a,s,d,and spacebar in ordering. Player will receive score once they are destroy enemy the 'turtle' in this game. But if player is collided by enemy, they are decreased lives by one. Once lives reach 0, Game is Over.
At the end,there is the leadership scoreboard represent whose hit the highest score and the second,third... respectively.
special thank you to TokyoEdtech for learning resources.
Rocket Shoot Game is created by many source code. Description below Here.
This Class is the Super class of Python turtle inherit object for the flying objects in this program. This module requires serveral attributes which are shape to shape the turtle, color to paint the turtle, pos for position of object and private attribute speed to set its speed.
- is_collided(other) : To check whether objects collided or not.
Aircraft class is the child class of Mold Super class which intialize flying objects. This class adding attributes lives and score to represent aircraft lives and its earned from destroyed enemies.
move(), move_up(), move_down(), move_forward(), move_backward(). to control the movement of airplane object.
This class is child class of Mold class. This class is similar to its parent class. Whose represent enemies in this program.
move() to move in linear direction toward the player.
Bullets class is also child class of Mold class. Representing bullets object, with privated attributes status and pilot which use to considering firing or not and whose pilot going to be shooting the bullets.
firing(), move() are cooperate to firing the bullet. The firing() will change status to firing when player activate firing by pressing spacebar if the current status is ready only. move() is move bullets to the outside screen.
Class to setting up display window size and background picture.
setting up the display window.
This class are setting up the border which is playing area of this game by given attributes corner, width, height. In this class have methods to show score status, display gameover word and also show leadership scores on the screen by turtle object as a painter.
- draw() is method to draw the border on the screen to be specify area of playing.
- show_status show the player score and lives on the left-top of the window.
- display_gameover() this method write the word 'GAMEOVER' and player score on the center of the screen
- display_rank() this method writing leadership by player name and thier score on screen. Whose highest score represent at the first lines of leadership section.
Class Read takes the field of collect player name and score, then insert these information to the database json file to be the record of leadership score.
- insert() : insert player name and their score into the database.json file.
- get_top() : Return list contains player name and thier score in Decsending order from database.json file.
This class is the Datatype class. Define Vector in 2D space.
p.s. from week10 assignment