DOC PREVIEW
MIT 6 111 - Frogger

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

FROGGER Nathan Vantzelfde Cory Zue 6.111 Introductory Digital Systems Laboratory Final Project May 13, 2004 Abstract Video games, introduced with the advent of computer technology have become extremely popular in today’s society. The old video game Frogger is designed and implemented on a Field Progammable Gate Array (FPGA). The goal of the game is to navigate an animated frog across a highway avoiding a series of cars, and then a river, jumping on logs and bobbing turtles. The interface to the game is an Atari joystick, and the game can be displayed on any VGA compatible monitor. The game consists primarily of two modules. The game module controls the logic of the game including the location of objects, movement of the frog, and end of game conditions. The video module displays the game data on the monitor, using images stored on a read only memory (ROM). Both modules use a major/minor FSM structure. Design and testing strategies are discussed.1 Introduction We designed and implemented the popular arcade game Frogger. The game consists of an animated frog that first crosses a highway and then a river. The goal of the game is to make it safely from the bottom of the screen to the top. The frog must cross the highway without colliding with a series of cars and trucks that move across the screen, alternating directions and varying speeds with each successive line of traffic. Each lane of the highway is a set of identical cars that move with the same speed. Between the highway and the river is one row of grass with no obstacles. Logs and lily pads float across the river, and the frog can only cross on these objects. If the frog reaches the top of the screen, the level is completed and the speed increases. Also, The number of cars on the freeway increases with each level, just as the number of logs and lily pads on the river decreases. If the frog collides with a car or falls in the water the game starts over with the frog at the bottom of the screen. The version of the game that we attempted to mimic is shown in Figure 1. Figure 1: The Frogger Arcade Game The input to the game is a standard Atari Joystick. This controller consists of four directional buttons (up, down, left, and right), and a fire button. The directional buttons control the movement of the frog, with each press corresponding to a movement of 1 unit (one lane of the highway). During gameplay, the fire button pauses the game, causing the screen to freeze. Releasing the fire button resumes play. The output of the game is a video signal for interfacing with the color TV monitors in the 6.111 lab. The video outputs are three color bits—red, green, and blue—and four synchronizing and blanking bits—horizontal and vertical synch and blank. 2 Gameplay Unit The gameplay unit is responsible for controlling the flow of the game. It processes user input from the joystick, moves the frog accordingly, and places and moves various other objects on the screen such as logs and cars. It tests for collisions between the frog and the other objects and acts accordingly, depending on whether the frog is on the road or over the river. It also tests whetherthe frog has safely reached the opposite side of the river, and if so, increases the level and the corresponding speeds of the cars and logs. A block diagram for the gameplay unit is shown in figure 2. A number of smaller modules have been omitted for clarity. The gameplay unit only has two inputs, a global reset signal and a five-bit input from the joystick. There are two large finite state machines, one to control the frog movement and one to control the flow of the game. All of the objects, including the frog, are stored in the ram, which has two read ports, one of which is used by the video unit to access the type and location of all the objects. The gameplay unit also outputs a signal num_objs to the video unit, which signals how many of the locations in the object ram contain valid objects to be displayed. Each of the major modules of the gameplay unit will be discussed in subsequent sections. 2.1 Synchronizer and Divider The synchronizer synchronizes asynchronous inputs from the joystick and reset signal to the system clock by delaying each bit through two or more registers. The divider produces a 15 Hz enable signal from the 27 MHz system clock. This enable signal is used by the frog FSM, the gameplay FSM and the several of the other modules to signify to start a new game cycle, since each object is updated only once every 1/15 second. The divider also takes the pause input from the joystick interpreter; when pause is high, the divider stops produces the enable signal, effectively stopping the every element of the game in its current state. JoystickInterpreterFrog FSMSynchronizerDividerGameplay FSMObjectRAMOverlapTesterObjectBoundsObjectPlacerfrog_leftfrog_rightoverlapupdownleftrightpausereset(global)ram_qram_q_2resetupdatedram_dataenable(to several modules)frog_topfrog_bottomobj_leftobj_rightobj_topobj_bottomshould_addadd_nextobjram_dataram_addr_2read_en_2num_objsjoytstick_invariouscontrolsignalsfrogram_dataFigure 2: Block Diagram for the Gameplay Unit2.2 Joystick Interpreter The joystick interpreter is responsible for taking in the five-bit synchronized input from the Atari joystick and produce five usable signals, pause, up, down, left, and right, the first of which is used by the divider to pause the game and the latter four of which are used by the frog FSM to control the frog’s movement. The Atari joystick has five output pins, corresponding to each of the four cardinal directions and one for the button. These pins are forced low when the corresponding direction or button is pressed. Before being used by the gameplay unit, each of these signals are passed through two inverters on the lab kit to ensure that each has a valid voltage level before being used by the FPGA. The joystick interpreter, therefore, needs only to invert each of the five signals to generate the desired signals. While the joystick module is not very complex, it was included in the design nevertheless so that the function of processing the user input is decoupled from other modules. That is, if we chose to switch to a difference joystick, only the joystick interpreter would need to be change; all other modules will not by affected at all. 2.3 Frog FSM The frog FSM maintains the frog’s position and


View Full Document

MIT 6 111 - Frogger

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Frogger
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Frogger and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Frogger 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?