-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class Tank{ | ||
|
||
tankWeapon; //which particular type of weapon the tank has | ||
bullets; //how many bullets the tank has left available | ||
tankLife; //remaining life of the tank | ||
|
||
//note the image, rotation and speed will be attributes of the sprite | ||
|
||
//locX and locY are the initial co-ordinates | ||
//initialDirection is the initial direction the tank is pointing in | ||
//initialWeapon is the weapon the tank has to begin with | ||
constructor(locX, locY, initialDirection, initialWeapon){ | ||
//create a sprite in P5 Play for the tank | ||
} | ||
|
||
draw(){ | ||
//call the draw method of the underlying sprite | ||
} | ||
|
||
fire(){ | ||
} | ||
|
||
destroy(){ | ||
} | ||
|
||
update(){ | ||
//call the update method of the underlying sprite | ||
} | ||
|
||
//updates the rotation and speed attributes of the tank sprite | ||
//directionOfMove corresponds to either UP, DOWN, LEFT or RIGHT | ||
move(directionOfMove){ | ||
} | ||
} |