A fun side-scrolling platformer written in Java based on the original Super Mario Run game for iOS!
- About The Project
- Additional Documentation
- New Enemy & Coin Tracker Update
- Screenshots
- Minimum Requirements
- Getting Started
- License
- Acknowledgements
Please visit Documentation.pdf for additional project documentation containing use cases, UML class diagram, interaction diagrams, algorithms, and key accomplishments.
The new update introduces Koop Troopa which are turtle-like creatures. Similar to Goombas, the player needs to stomp on top of them to knock them out. A new Enemy interface is also implemented for a new merged Enemy class that handles the operation of both the original Goomba and the new Koopa Troopa. The speed of the enemies are also now dynamically implemented from a text file. Furthermore, every level now has a coin tracker on the top right which displays and dynamically updates the number of coins that are collected in the current level as the player progresses through it.
A) The Enemies interface contains methods that are going to be used in the Enemy Class
interface Enemies
updateBounds() Method that updates the location of invisible head and body GRectangles for collision detection
Run() Method that initiates enemy and boundary movement and detects player collision
getEnemySpeed() Method that returns current enemy's speed from text file
getEnemyImage() Method that returns current enemy's image file
B) The Enemy class manages the location, movement, speed and collision detection of desired enemy (Goomba or Koopa Troopa)
class Enemy that implements the Enemies interface
Enemy initialization constructor (main, levelPane, String enemyType, locationX, locationY)
set program to main
set level to levelPane
set enemy type (Goomba or Koopa Troopa) to parameter enemyType
set enemyImg to the image of enemy at location (locationX, locationY)
initialize head to an invisible GRectangle object with appropriate height and width
initialize body to an invisible GRectangle objectwith appropriate height and width
set enemySpeed to the value extracted from text file returned by getEnemySpeed
// Update head and body GRectangles to appropriate locations surrounding the enemy's head and body
updateBounds()
set location of head GRectangle around enemy's head
set location of body GRectangle around enemy's body
// Retrieve enemy speed from text file
getEnemySpeed()
open text file determined by enemy type
set enemySpeed to first integer in text file and return
// Return enemy image
getEnemyImage()
return enemy image
// Manage enemy movement and track enemy collision with player
Run()
if enemy is within 1000 pixels distance of the player
move enemy at speed extracted from text file
update enemy's collision boundaries
else
move enemy at default speed
update enemy's collision boundaries
if player has equipped star power up and player touches enemy
kill enemy
else if player collides with enemy's head
play stomp sound
kill enemy
else if player collides with enemy's body
kill player
C) The Constructor and actionPerformed methods in the LevelPane class are now used to implement a dynamic coin tracker
LevelPane()
Initialize new coin counter GIF file at desired location in top-right of screen
Initialize new coin counter label at desired location in top-right of screen and set it to current number of coins collected
Set color of GLabel to white
ActionPerformed()
check if character has collected coin and update current number of coins collected accordingly
Update coin counter label to current number of coins collected
- Start Game
- Click on Tour
- Click on any level that is unlocked
- Koopa Troopas now visible on selected level as you play through
- Coin Tracker on top-right of screen is present and dynamically updated as you collect coins
GPU: ARM Mali-400 or equivalent
RAM: 1 GB
Storage: 500 MB
Display: LCD Color Display
OS: Windows 10 version 1507/macOS 10.14 Mojave (Liberty) Import this project into Eclipse IDE and run the mainSMR.java file
Distributed under the MIT License.