Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3: (State Machines) You're writing a controller for a simple 2D side-scrolling game. The controller has an Up button and a Down button. The

image text in transcribed

Question 3: (State Machines) You're writing a controller for a simple 2D side-scrolling game. The controller has an Up button and a Down button. The game character is continuously moving forward (walking) in the game. When the player presses the Up button, the character should jump; when the player presses the Down button, the character should crouch down For each question, if you make any assumptions or interpretations not explicit in the instructions, write them down. Draw a state machine diagram to implement the system. Your supervisor passes by as you're working and says, "Hey, gravity must always win out in the end! Make sure the player can't get the character to fly off into the air by repeatedly pressing or holding down 'Up' while in middle of jumping. Continuous crouching is allowed, though." Draw a new state machine diagram that explicitly enforces gravity, per your supervisor's warning. Write a state table (started below) for the above. a. b. c. State Event Next state Walk None Walk d. One of the game's graphic designers passes by and says, "We're adding an aquatic environment to the game. Can you add a Dive state, triggered when the player Jumps, then presses Down? If the dive happens over water, the character will then be swimming, but otherwise it will hit the ground head first and die. If the character walks into water without diving, it'll die. Oh, and when the character reaches land, the player has to press Up to get out of the water and resume walking - otherwise the character will die. If the player presses Up or Down while the character is underwater but not near the shore, it should have no effect." Draw a modified state machine diagram that accommodates the new aquatic environment in the game (in addition to the other, previously stated, game requirements) Question 3: (State Machines) You're writing a controller for a simple 2D side-scrolling game. The controller has an Up button and a Down button. The game character is continuously moving forward (walking) in the game. When the player presses the Up button, the character should jump; when the player presses the Down button, the character should crouch down For each question, if you make any assumptions or interpretations not explicit in the instructions, write them down. Draw a state machine diagram to implement the system. Your supervisor passes by as you're working and says, "Hey, gravity must always win out in the end! Make sure the player can't get the character to fly off into the air by repeatedly pressing or holding down 'Up' while in middle of jumping. Continuous crouching is allowed, though." Draw a new state machine diagram that explicitly enforces gravity, per your supervisor's warning. Write a state table (started below) for the above. a. b. c. State Event Next state Walk None Walk d. One of the game's graphic designers passes by and says, "We're adding an aquatic environment to the game. Can you add a Dive state, triggered when the player Jumps, then presses Down? If the dive happens over water, the character will then be swimming, but otherwise it will hit the ground head first and die. If the character walks into water without diving, it'll die. Oh, and when the character reaches land, the player has to press Up to get out of the water and resume walking - otherwise the character will die. If the player presses Up or Down while the character is underwater but not near the shore, it should have no effect." Draw a modified state machine diagram that accommodates the new aquatic environment in the game (in addition to the other, previously stated, game requirements)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions