+ All Categories
Home > Documents > Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan...

Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan...

Date post: 24-May-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
11
Ninja Guild Ninja Guild Ryan Wilson Ryan Wilson Alex Klinkhamer Alex Klinkhamer Jason Vivian Jason Vivian CS 3141 – Spring 2009 CS 3141 – Spring 2009 Michigan Tech University Michigan Tech University
Transcript
Page 1: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

Ninja GuildNinja GuildRyan WilsonRyan Wilson

Alex KlinkhamerAlex KlinkhamerJason VivianJason Vivian

CS 3141 – Spring 2009CS 3141 – Spring 2009Michigan Tech UniversityMichigan Tech University

Page 2: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

Entity

positionX < size, positionX >=0, positionY < size, positionY >=0

An entity is always inside a room, so its position should always be within the bounds of the size of the room.

Page 3: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

Fighter CharacterInvariant: HP <= maxHP,

A fighter character can never have a current health value over his starting or initial one.

move -pre: requestedPosition.isValid == true, AP > 0post: positionX < size, positionX >=0, positionY < size, positionY >=0; AP = AP-1

In order to move, the position that you want to move to has to be a valid one inside the grid. After this method completes, you should still have a valid position (a new one) and your AP should be -1 what it used to be.

attack -pre: x == positionX +| - 1, y == positionY +| - 1, position(x,y) instanceOf fighterCharacterpost: positions (old) == positions (new)

To attack, the square you want to attack has to be adjacent to you. This method should not change the positions of any entities.

die -pre: HP <=0 && isAlive == truepost: isAlive == false

“Death” comes to a player or enemy when their HP reaches zero.

Page 4: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

DungeonInvariant: target (old) == target (new); roomList (old) == roomList (new)

The dungeon’s invariant simply makes sure that the game constants don’t change. The target, or goal of the game, should never change throughout the game. Also, the rooms inside the dungeon should not change at all (even though they are randomized at the start).

playersWin -pre: target.hp == 0post: winScreen.visible == true

The players win when the successfully assassinate the target. This means that they bring its health, or HP, to 0. After this method is called, a win screen should be displayed and the game should be over.

Page 5: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

PlayerInvariant: Ninja != null

The player always should have a Ninja to play the game with.

sendMove -pre: isConnected == truepost: isConnected == true

In order to send the game a move, the player must be connected to the system.

endTurn -pre: myTurn==true, isConnected == truepost: myTurn == false

For the player to end his turn, he must be connected to the system, and it must be his turn. After this method ends, it should no longer be that player’s turn.

takeAction -pre: isConnected == true, AP > 0post: AP (new) < AP (old)

To take an action, the player must be connected to the system as well as have more AP (action points) to use.

Page 6: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

Item

Invariant: numUses >=0

An item cannot have negative uses. This would most likely cause a bug where an item could be used an infinite amount of times.

doEffect -pre: numUses > 0post: numUses (new) == numUses (old) – 1

To do an item effect, the item has to have uses left. Afterwords, the use count should be one less than it was before.

Page 7: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.
Page 8: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.
Page 9: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

Dungeon Creation

For each room

Randomize 2-4 doors

check door adjacency

Randomize 1-5 enemies

Randomize 1-5 pillars

Randomize 1 light

setShadows

loop

Page 10: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

setShadows

For each pillar

For X position, mark opposite squares

For Y position, mark opposite squares

loop

for each square

if square has been marked twice

mark as shadowed

loop

Page 11: Ninja Guild - pages.mtu.eduaebnenas/teaching/spring2009/cs3141/teampres... · Ninja Guild Ryan Wilson Alex Klinkhamer Jason Vivian CS 3141 – Spring 2009 Michigan Tech University.

Questions?Questions?


Recommended