Giter Club home page Giter Club logo

mortyrun-game's Introduction

Morty's Run Game

Aims

  • Appreciate issues in user interface design
  • Learn practical aspects of graphical user interface programming
  • Learn more about the Java class libraries
  • Learn the application of design patterns
  • Make a wacky game in the process

Overview

This project was done for a object oriented programming course in UNSW. Written by Leonard Lee and Zachary Tan. Special thanks to Well son and Wei ze!! ๐Ÿ‘

๐ŸŽฅ Sample gameplay on YouTube

Setup

  1. Download and set-up Visual Studio Code here ๐Ÿ‘‰ VSCode

  2. set up java jdk here ๐Ÿ‘‰ vscode for java

    • download the installer for your Operating System (windows/mac)
  3. Go to Extension tab in VSCode and in the search bar look for 'Java Extension Pack'

    • this package includes the java code runner so we can launch the game.
    • details of the extension here ๐Ÿ‘‰ Java Extension Pack
  4. That should do it! โญ Go to src/unsw/dungeon/FrontendApplication.java โญ and click on 'Run' on top of the main function.

โ— IMPORTANT โ— The set-up is currently tested and working for macOS and Linux.

โ— IMPORTANT โ— for windows, first download git here, then checkout into the 'windows' branch and follow setup steps 1 - 4.

The different levels

The client desires an application that lets the user move a player around a dungeon and try to overcome various challenges in order to "complete" the level by reaching some goal.

Here is how the start menu looks like:

Start

Be sure to read the instructions for the game and go on to select the different level maps!

Rules

Select

Here's a glimpse as to how they look like!

Maze Maze2

Dungeon layout

To be specific, the layout of each dungeon is defined by a grid of squares, each of which may contain one or more entities. The different types of entities are as follows:

Entity Example Description
Player Player Can be moved up, down, left, and right into adjacent squares, provided another entity doesn't stop them (e.g. a wall).
Wall Wall Blocks the movement of the player, enemies and boulders.
Exit Exit If the player goes through it the puzzle is complete.
Treasure Treasure Can be collected by the player.
Door Door Door Exists in conjunction with a single key that can open it. If the player holds the key, they can open the door by moving through it. Once open it remains so. The client will be satisfied if dungeons can be made with up to 3 doors.
Key Key Can be picked up by the player when they move into the square containing it. The player can carry only one key at a time, and only one door has a lock that fits the key. It disappears once it is used to open its corresponding door.
Boulder Boulder Acts like a wall in most cases. The only difference being that it can be pushed by the player into adjacent squares. The player is only strong enough to push one boulder at a time.
Floor switch Floor switch Switches behave like empty squares, so other entities can appear on top of them. When a boulder is pushed onto a floor switch, it is triggered. Pushing a boulder off the floor switch untriggers it.
Portal Portal Teleports entities to a corresponding portal.
Enemy Enemy Constantly moves toward the player, stopping if it cannot move any closer. The player dies upon collision with an enemy.
Sword Sword This can be picked up the player and used to kill enemies. Only one sword can be carried at once. Each sword is only capable of 5 hits and disappears after that. One hit of the sword is sufficient to destroy any enemy.
Invincibility potion Invincibility If the player picks this up they become invincible to enemies. Colliding with an enemy should result in their immediate destruction. Because of this, all enemies will run away from the player when they are invincible. The effect of the potion only lasts a limited time.
Invincible mode Inv This is how morty looks like in invincible mode. (After picking up potion)
Armed mode Armed This is how morty looks like in armed mode. (After picking up sword)

Goals

In addition to its layout, each dungeon also has a goal that defines what must be achieved by the player for the dungeon to be considered complete. Basic goals are:

  • Getting to an exit.
  • Destroying all enemies.
  • Having a boulder on all floor switches.
  • Collecting all treasure.

More complex goals are being stated in the side panel in the game Dungeon window.

Input

๐Ÿ“ notes for setting goals (CLICK ME TO FIND OUT)

This application will read from a JSON file containing a complete specification of the dungeon (the initial position of entities, goal, etc.).

The dungeon files have the following format:

{ "width": width in squares, "height": height in squares, "entities": list of entities, "goal-condition": goal condition }

Each entity in the list of entities is structured as:

{ "type": type, "x": x-position, "y": y-position }

where type is one of

["player", "wall", "exit", "treasure", "door", "key", "boulder", "switch", "portal", "enemy", "sword", "invincibility"]

The door, key, and portal entities include an additional field id containing a number. Keys open the door with the same id (e.g. the key with id 0 opens the door with id 0). Portals will teleport entities to the one other portal with the same ID.

The goal condition is a JSON object representing the logical statement that defines the goal. Basic goals are:

{ "goal": goal }

where goal is one of

["exit", "enemies", "boulders", "treasure"]

In the case of a more complex goal, goal is the logical operator and the additional subgoals field is a JSON array containing subgoals, which themselves are goal conditions. For example,

{ "goal": "AND", "subgoals":
  [ { "goal": "exit" },
    { "goal": "OR", "subgoals":
      [ {"goal": "enemies" },
        {"goal": "treasure" }
      ]
    }
  ]
}

Note that the same basic goal can appear more than once in a statement.

User interface

The UI component of this project will be implemented in JavaFX.

The client has given you free reign over the visual design of the program. Included in the starter code are some example assets, but you are free to use different ones. The examples above came from here.

have fun!

mortyrun-game's People

Contributors

leonardlwq avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.