Jing ¡Shi Sprite ¡Display ¡Modules ¡and ¡Driver Mingxin ¡Huo Audio ¡Modules ¡and ¡Driver Yifan ¡Li Software ¡for ¡game ¡logic Siwei ¡Su Software ¡for ¡game ¡logic
Jing Shi Sprite Display Modules and Driver Mingxin Huo Audio - - PowerPoint PPT Presentation
Jing Shi Sprite Display Modules and Driver Mingxin Huo Audio - - PowerPoint PPT Presentation
Jing Shi Sprite Display Modules and Driver Mingxin Huo Audio Modules and Driver Yifan Li Software for game logic Siwei Su Software for game logic Name Function
Submodule: ¡ROM ¡ ¡ Parameter: ¡HEIGHT, ¡WIDTH ¡ ¡ Input: ¡hc, ¡vc, ¡clk, ¡(X, ¡Y) ¡ ¡ Output: ¡R, ¡G, ¡B, ¡Valid ¡ ¡ Signals: ¡ROM ¡address, ¡ ¡
- Name
Function HEIGHT, ¡WIDTH Define ¡the ¡height ¡and ¡width ¡of ¡this ¡ Sprite ¡Picture hc, ¡vc Horizontal ¡Count ¡and ¡Vertical ¡ Count, ¡define ¡current ¡pixel ¡location (X, ¡Y) The ¡coordinate ¡of ¡the ¡Sprite, ¡ determines ¡where ¡to ¡put ¡the ¡Sprite R, ¡G, ¡B The ¡RGB ¡value ¡of ¡the ¡Sprite Valid Whether ¡the ¡VGA ¡scan ¡location ¡(hv, ¡ cv) ¡is ¡within ¡the ¡Sprite ¡region ROM ¡Address Calculate ¡the ¡address ¡of ¡current ¡ pixel ¡RGB ¡value ¡in ¡ROM
- 1. How ¡to ¡debug ¡in ¡hardware ¡
- 2. Need ¡to ¡handle ¡the ¡positive ¡or ¡negative ¡signed ¡of ¡
calculation ¡
- 3. Top-‑to-‑Down ¡Design ¡Methodology ¡
- 4. The ¡ importance ¡ of ¡ team ¡ work ¡ especially ¡ when ¡
design ¡the ¡interface ¡of ¡different ¡modules ¡(like ¡the ¡ input/output ¡ports, ¡and ¡timing), ¡otherwise ¡it ¡would ¡ become ¡a ¡nightmare ¡when ¡try ¡to ¡assemble ¡all ¡the ¡ modules
Original acceleration sample data plot Reassembled acceleration sample data plot Modified acceleration unsigned integer type sample data (partial) plot
* Motivated ¡by ¡car ¡racing ¡video ¡games ¡ * Using ¡keyboard ¡to ¡control ¡your ¡car ¡and ¡trying ¡your ¡best ¡to ¡ get ¡first ¡place ¡in ¡the ¡game ¡ ¡ * Play ¡issues: ¡ ¡ ¡ ¡1. ¡Be ¡careful ¡not ¡to ¡hit ¡other ¡cars ¡and ¡road ¡margin, ¡otherwise ¡ you’ll ¡get ¡penalty ¡ ¡ ¡ ¡2. ¡Try ¡your ¡best ¡to ¡eat ¡more ¡coins ¡as ¡much ¡as ¡possible ¡to ¡get ¡ a ¡speedup ¡reward.
Overview
Game ¡Logic ¡Flowchart
START Leftkey pressed Rightkey pressed Collision No Yes No Player’s car move left Player’s car position reset Speed slow down Collision Yes No Player’s car move right Yes Yes No Upkey pressed Yes No Initializing all game status Cars move Score >= 5 Yes Speed up No Hit coin Score ++ Yes No Cars’s distance within passing range Yes Yes Pass No Timer >= Set time End No Yes
Movement ¡issues
) )) ( ) ( ( )) ( ) ( ( ) ( ) ( , )) ( ) ( ( )) ( ) ( ( ) ( ) ( ( ) , (
2 2 2 2
y B y A x B x A y B y A y B y A x B x A x B x A y x ab − + − − − + − − = ) )) ( ) ( ( )) ( ) ( ( ) ( ) ( , )) ( ) ( ( )) ( ) ( ( ) ( ) ( ( ) , (
2 2 2 2
y C y A x C x A y C y A y C y A x C x A x C x A y x ac − + − − − + − − =
- By ¡ calculating ¡ vector ¡
AB ¡ and ¡ AC, ¡ we ¡ could ¡ easily ¡ control ¡ the ¡ location ¡and ¡movement ¡
- f ¡trees ¡and ¡clouds.