Design a tom and jerry themed game for the teensy

Assignment Help Other Subject
Reference no: EM132393896

Assignment

Context

You are tasked with designing a Tom and Jerry themed game for the teensy pewpew platform. Jerry, who will be controlled by the user, just wants to eat cheese and dodge Tom. After he has had a few pieces of cheese, he likes to have a bit of fun by setting off fireworks in pursuit of Tom.

Tom, ever the strategist, moves randomly around the room, dropping mousetraps periodically in hopes of catching Jerry. After becoming increasingly frustrated at Jerry for thwarting his plans, when the characters advance to the second room, Tom decides to get smart and mix a chemical concoction into some bowls of milk to leave for Jerry. However, this has some unexpected consequences, with the milk giving Jerry temporary superpowers!

For a short burst of time after consuming the milk, super-Jerry can not only walk through walls, but is also invincible to Tom and his traps. The characters roam through increasingly variable environments, with moving walls to dodge in addition to the other game elements. These behaviours are explained further in the task breakdown below.

Level 1 Specifications

Task 1 – Basic Behaviours

a) Basic Game Requirement - Debouncing

You will need to debounce all switches on the teensy for playability. If a behaviour cannot be easily demonstrated because a switch is not debounced, no marks will be awarded for that criteria.

b) General Game Setup

Your game should begin with a start screen, which displays your name, student number, and the name of your game (you may choose this, but it must be appropriate). The game should remain on this start screen until the right switch is pressed. Once the right button press has
been detected, the initial game screen should be drawn. The characters and walls should be drawn in their initial positions, as described further in Task 1c. There should also be a status bar at the top of the screen, above the gameplay area, which should contain in order the
following information:

i. The current level (initially 1),

ii. Jerry’s remaining lives (initially 5),

iii. The score (initially 0),

iv. The game time, formatted with leading zeros, displayed as MM:SS (initially 00:00).

You will also need to draw a horizontal line across the entire screen under this information, separating the gameplay area from the status bar.

c) Character and Wall Setup

The initial positions of the characters and walls in level 1 can be manually programmed. The characters should be denoted by bitmaps with width in the range of 3-5 pixels and height in the range of 3-7 pixels (you may choose the bitmap, as long as the characters can be easily
identified). The initial game state is given by the following absolute coordinates:

i. Tom should be drawn at (LCD_X – 5, LCD_Y – 9),

ii. Jerry should be drawn at (0, STATUS_BAR_HEIGHT + 1),

iii. A wall should be drawn from (18, 15) to (13, 25),

iv. A second wall should be drawn from (25, 35) to (25, 45),

v. A third wall should be drawn from (45, 10) to (60, 10),

vi. A fourth wall should be drawn from (58, 25) to (72, 30).

d) Pause Mode

If the user closes the right switch at any time during game play, the game should enter a pause mode. In pause mode, the game time stops, and all timer-based or automated game elements will cease to update. Jerry can still be moved manually, and should be able to
interact with the cheese, mousetraps, Tom and walls as normal, but no new cheese, mousetraps or milk should appear, and Tom and the walls should not move. The game can be unpaused by pressing the right switch again.

e) Character Movement

Jerry’s movement should be controlled by the joystick up, left, down and right switches (with Jerry moving one pixel in the direction of joystick movement per switch press). Tom’s movement should be automated and random, such that each time Tom collides with a wall or the edges of the screen, he proceeds to move at a new random speed and direction. The random movement parameters should be different each time the game is played. When Jerry is moving at full speed (a switch is held closed), Jerry can outrun Tom. No part of the
characters can ever leave the screen, nor can any part of the characters move through walls (except the behaviours described in Task 3).

f) Collision Detection

You will need to implement a collision detection algorithm to detect interactions between game elements. Tom and Jerry must be entirely visible on screen at all times, and no part of either character can move into walls or the status bar. If Tom catches Jerry (any part of the
characters’ bitmaps overlap), Jerry loses a life and both characters are reset to their initial positions. You must also have collision detection between all other game elements, as described in the relevant task descriptions.

g) Cheese Appearance and Interaction

One piece of cheese is spawned every 2 seconds, up to a maximum of 5 in the room at once. Cheese can appear in any unoccupied area within the room, and there should be no noticable pattern in the cheese spawning locations. Jerry consumes a piece of cheese if any part of his bitmap overlaps any part of the cheese bitmap. Each time Jerry eats a piece of cheese, another piece of cheese appears 2 seconds after it has been consumed. If he consumes multiple very quickly, spawn one piece 2 seconds after the first piece was eaten, and each
successive piece at 2 second intervals afterwards. Each piece of cheese Jerry consumes increases his score by 1. Tom has no interaction with cheese. Cheese does not move, so the number of cheese on screen should be reset when the characters move to the next room.
Further cheese interactions are detailed in Tasks 1i and 1j.

h) Mousetrap Appearance and Interaction

Tom drops mousetraps at his current location as he moves around the room (and hence can never spawn overlapping existing game elements). These mousetraps appear at 3 second intervals, up to a maximum of 5 traps in the room at one time. Jerry gets caught by a trap if any part of his bitmap overlaps any part of the mousetrap bitmap. When Jerry steps on one of Tom’s traps, he loses 1 life, but may continue on his path. Mousetraps become inactive and disappear from view after Jerry has stepped on them, and 3 seconds later another
mousetrap is spawned at Tom’s current location. Tom has no interaction with mousetraps after spawning.

i) Door Appearance and Interaction

Once Jerry has eaten 5 pieces of cheese in the current room, the door to the next level appears. You may choose the door bitmap, but it needs to be distinct and of a sensible size. The door appears at a random, unoccupied location on the screen, and cannot spawn over
the current location of any other existing game elements. Cheese continues to spawn after the door spawns, and Jerry does not have to go through the door immediately. Once any part of Jerry’s bitmap overlaps any part of the door bitmap, the characters are both transported tothe second room. See level 2 specifications for further game functionality. If level 2 is not implemented, or the player moves through the door in level 2, this should bring up a game over screen, with the option to restart by pressing the right button.

j) Jerry’s Weapons: Fireworks

Once Jerry has eaten 3 pieces of cheese, he gains the ability to use fireworks as weaponry against Tom, and retains this ability until game over or reset. Jerry’s fireworks should be a single pixel, and should continually update their direction to follow Tom. If fireworks hit any walls or the edges of the game area before reaching Tom, they disappear. Jerry has 20 fireworks at his disposal, and gains another firework each time one disappears from the screen. One firework is fired each time the joystick centre switch is closed. Fireworks cannot follow the characters between rooms.

Task 2 – Further Movement and Control (6 marks)

a) Wall Movement

The rooms offer some additional challenges for Tom and Jerry. The walls can move, sometimes closing in on the characters and trapping them, causing them to be reset to their initial location. All the walls move with a velocity directed perpendicular to the wall itself, and a speed slower than either of the characters. If the walls reach the boundaries of the screen, they should wrap around and reappear on the other side of the screen at the appropriate location to continue their trajectory. The walls have no interaction with cheese, mousetraps or milk other than the spawning requirements detailed in the relevant Task 1 specifications. See Appendix element (a) for a visual representation of the wall movement.

b) ADC Speed Control

To add an extra level of control to the game, the potentiometers on the pewpew are used to scale the playing speeds. The right potentiometer is used to scale the velocity of the walls, with the range [-MAX, MAX]. This will be such that the negative of a given scaling factor should invert the direction of movement (the wall will move in the opposite direction). The left potentiometer should scale the movement speed of the characters, with the range [0, MAX]. In the instance of both the characters and the walls, the maximum speeds must be appropriate for playability.

This should satisfy the following:

i. Wall Speed < Tom Speed < Jerry Speed,

ii. Tom’s and Jerry’s speeds must remain proportional as they increase and decrease.

Level 2 Specifications

Task 3 – New Behaviours and PWM (8 marks)

a) Level 2 Requirement – Level Change Button

To qualify for level 2 marks, you must implement the ability to change levels by closing the left switch. If this is not implemented, you will not qualify for any marks for further functionality (i.e. you will not receive any marks for Task 3 or 4 functionality).

b) Powerful Potions

Tom, in his desparation to catch Jerry, has decided to mix chemicals into some bowls of milk to leave for Jerry. However, his methods backfired, with Jerry gaining superpowers for a short period after consuming each bowl of milk. Tom only has one bowl available for milk, and places the bowl of milk at his current location at 5 second intervals (you may design an appropriate bitmap). Once any part of the bitmap for the bowl of milk overlaps any part of Jerry’s bitmap, the bowl of milk disappears from the screen, and does not respawn for 5 seconds. Jerry begins a 10 second super-Jerry mode, which involves the following behaviours:

i. Jerry can move through walls,ii. Jerry has no interaction with mousetraps,

iii. Jerry gains 1 point if he catches Tom (and cannot lose lives),

iv. Jerry’s bitmap increases by 1 size, and

v. Both LEDs gradually flash from a low to high light intensity in a defined sequence controlled by PWM.

These behaviours can only be exhibited in super-Jerry mode.

Task 4 – Serial Communication (12 marks)

a) Establishing Connection

Upon commencement of level 2, a serial connection should be initialised. If Task 4d is implemented, the game should expect all inputs to be coordinates of game elements until an end of file command is received.

b) External Game Control

The functionalities described in level 1 can also be controlled via serial. This behaviour should be as follows:

i. The keys ‘w’, ‘a’, ‘s’, and ‘d’ can be used to move Jerry up, left, down and right, respectively,

ii. The ‘p’ key toggles pause mode,

iii. The ‘f’ key fires a firework (if available), and

iv. The ‘l’ key changes the level.

c) Game State Information

Using the established serial connection, the user can request game state information at any time by pressing the ‘i’ key on the keyboard. The game information should be sent from the teensy via serial to the connected computer, and should include the following:

i. A timestamp,

ii. The current level number,

iii. Jerry’s lives,

iv. The score,

v. The number of fireworks on screen,

vi. The number of mousetraps on screen,

vii. The number of cheese on screen,

viii.The number of cheese which has been consumed in the current room,

ix. A true or false value for whether Jerry is in super-mode,

x. A true or false value for whether the game is paused.

d) Input Parsing

The game elements for level 2 can be initialised by parsing input from a text file. Inputs should continue to be read until the end of file is detected. After the text file has been read, the serial connection should still remain open, and should still accept and respond appropriately to keyboard inputs. The text file will contain coordinates for Tom and Jerry, and coordinates for each wall. You may assume there will never be more than 6 walls. The formatting for each of the encoded elements is presented in the example below:

i. T 79 39

ii. J 0 10

iii. W 18 15 13 25

You should create your own text files to test with, using this formatting. These will be absolute coordinates, there is no need to scale to screen size. A maximum status bar height of 10 pixels will be assumed. The length of the walls will never be greater than the largest of those drawn in Level 1.

Reference no: EM132393896

Questions Cloud

Great considerations of company : One of the great considerations of any company is that growth is an issue that needs to be addressed.
How epidemiological data influence change in health practice : Describe how epidemiological data influences changes in health practices. Provide an example and explain what data would be necessary to make a change.
Identify three leadership traits : Research the leadership traits, behaviors, and skills from the literature that contemporary leaders demonstrate. Then answer the following questions:
How information and data are used to direct patient care : Discuss ways your organization uses technology to gather patient and health care information, and how this information and data are used to direct patient care.
Design a tom and jerry themed game for the teensy : CAB202-You will need to debounce all switches on the teensy for playability. If a behaviour cannot be easily demonstrated because a switch is not debounced.
What is content analysis : What is content analysis? How can it be applied to analyze data gathered from personal interviews. Please provide references
Describe the reporting mechanism in florida : Child abuse and maltreatment is not limited to a particular age-it can occur in the infant, toddler, preschool, and school-age years. Choose one of the four.
Maintain a competitive advantage : To what point are we expected to work in order to maintain a competitive advantage?
Leading approaches to defining quality : What is the comparison and contrast between the leading approaches to defining quality and how you create quality in your life?

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd