Description
In this assignment you will be building a game app called MazeMan using Sprite Kit. There will
be two scenes: Main and Game Over scene.
A) Main Game Scene:
Assume the app will be run only in iPad and in landscape left and right modes only. You can
further set the screen size to iPad Pro screen size of (1024, 1366).
Game will start with blocks (obstacles) only in bottom (one row) and top part (two rows). Button
row will include two water blocks. As the game goes on, there will be a block added in every 1
second until 15 (maxBlockCount) blocks are added. Adding the blocks into the game scene
should not result overlapping items. To this extend, you can divide the screen into grids (64 x 64)
and put blocks only to grids available (not occupied by food, star, player, or previous blocks).
Player:
Initial location of the player will be lower left corner, facing right. The facing direction of player
will change either to left or right, depending on movement.
a) Life: Initially player will have 3 lives (hearts). Every time its energy becomes zero, it loses
one heart.
b) Energy: 1 Life (heart) is 100 energy. Every second it loses energy. It can gain energy by
eating the food (50 energy). It loses energy if contacts to enemies.
c) Movement: Movement of player will be achieved by swipe gesture recognizers. Swiping
to any direction will result in player move in that direction until it hits an object or edge of
screen.
d) Shooting: Player can kill the enemies by shooting. When user clicks a location, there will
be a rock thrown towards the point user touched. Rock needs to travel until it goes out of
screen, not until it comes to touch location. Moreover, the speed of all rocks thrown in any
direction should be the same (use a unit vector). Rock can go through blocks. Initial rock
count of player is set to 10. Every time it shoots, loses one rock. Only way of earning new
rocks is by time (every 30 sec). Max rock count is set to 20, cannot earn more than this.
e) Dying: Player will die either when it loses all hearts and energy or drown in water
(immediate die). No gravity will be effective initially but it will be enabled after every random
time in range [40-60] seconds and will affect only the player.
Gravity will be effective only
1 second. Player will drown if it falls into water.
Enemies:
One instance of each enemy type will be added to the game at the beginning.
Enemies can go through blocks. Their damage to player’s health (energy) is different. They are
killed by rocks thrown by player. A new instance of killed enemy type reappears (after dying) after
randomly selected time in range [1-5] sec. Make all enemies moving slightly faster than player.
Enemy
Type
Image Damage to
Player
Entry Point Behavior
Dino1
60 energy
(0.6 heart)
Randomly selected
water block in the
ground row.
Goes up and down, then
waits randomly 1-3 sec
after each up and down.
Can go through blocks.
Dino2
80 energy
(0.8 heart)
Any row from right Goes left and right, waits
randomly 1-3 second after
each left and right. Facing
direction (left or right)
should change
accordingly. Can go
through blocks.
Dino3 100 energy
(1 heart)
Upper left corner,
facing right.
Can go all directions.
Selects a random direction
and continue till it hits
another object (including
blocks), then reselects
another direction. Facing
direction (left, right, up,
down) should change
accordingly.
Dino4 No damage
to player.
Not affected
by rocks
(immortal)
Left most point of
ceiling row.
It moves right and left at
the ceiling of the game
screen, and it can throw
fire balls every randomly
selected time in range [5-
10] sec.
Fire 100 energy
(1 heart)
From Dino4’s
position
Randomly created. It drops
down and goes out of
screen. Can go through
blocks.
Scores and Panels:
Node
type
Image Who can contact?
Star Every time player contacts a star, its score increases by 1 and
star disappears (removed from parent). Star is not affected by
enemies. Another star is added to screen immediately after the
previous star (at a random location which is not occupied).
Food Every time player contacts a food, its energy increases by 50
(half heart) – max 3 heart or 300 energy it can have – and food
disappears (removed from parent). Player status panel should
be updated accordingly. Food can also be eaten by enemy
types dino1, dino2 or dino3, (not by fire coming from dino4).
Another food is added to screen immediately after the previous
food (if eaten by player). If an enemy has eaten the food, then
new one will be added after 10 seconds.
Player Status panel will be updated with current counts of star (score), rock, heart and energy.
Game Status Panel will show messages to player regarding what is happening in the game.
Some message examples could be the following.
Please use your own.
1- Hello, Welcome to Mazeman!
2- Enemy (Dino1) killed
3- Bravo, you’ve got the star
4- Gravity time is very close! (maybe 3 seconds before it happens)
Music: Add music for 1) eating food, 2) scoring (contacting star), 3) shooting the rock, 4) when
rock kills enemy, 5) when player dies, 6) when player contacts to enemy.
B) Game Over Scene:
It will show a text label with the score of current game.
It will also show 3 high scores achieved till now.
Clicking screen will restart the game.
General Guidelines:
• Define your custom classes as needed.
• It is an iPad only app, and landscape only.
• Most image resources are provided (you may need to scale them), but you are encouraged
to create/use your own.
• Do not make your images stretched. Use aspect fit or fill for the content mode of the image
views.
• You can submit a README file if some changes are made (without affecting general
structure).
Submission Guidelines:
• Make sure your app is running before submitting. Also, make sure your submission
includes all files.
• Submissions should be made in Blackboard before midnight on 4/15. Up to 3 submissions are
allowed.
• Up to 2 days late submissions only (1 day 20% penalty, 2 days 40% penalty).
• Make sure all your images and other resources used are inside the project folder. When
copying an image inside the Assets folder, always make sure “copy” is checked and select
the target as the project.
General Grading Criteria:
Appearance: (40%)
a. Enemies, Player, Food, Star, Rock, Water, Blocks
b. Game Over Screen, High Scores
c. Player status panel
d. Game status panel
Functionality: (60%)
a. No overlapping of newly added nodes with current ones.
b. Scoring (when contacted with star)
c. Eating food (energy increase)
d. Losing energy (every second and every time enemy damages)
e. Movement of player by gesture recognizers until hitting a block
f. Killing of enemies by throwing rock (dino4 cannot be killed, only its fires can be
killed)
g. Throwing of rock from player towards touch point with same speed until out of screen
(Use your judgement for setting reasonable speeds to all sprites)
h. Dying (by enemies, water)
i. Applying gravity
j. Game Status panel updates (messages)
k. Player Status panel updates (rock, heart, energy and score updates)