Giter Site home page Giter Site logo

pjlyoko / fpga_vga_rs232_game Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 3 MB

A game using VGA controller and a RS232 communication written for Xilinx Spartan-3E board.

VHDL 91.53% Batchfile 0.58% XSLT 4.33% Tcl 3.56%
fpga xilinx spartan-3e-family vga-controller rs232 ucisw ucisw2

fpga_vga_rs232_game's Introduction

fpga_vga_rs232_game

A game using VGA controller and a RS232 communication written for Xilinx Spartan-3E board.

This repository contains files of a project created for a Digital circuits and embedded systems 2 course taken at Wrocław University of Science and Technology.

Final report (in Polish) can be read here.

The following text is a description of the game' mechanics.

Vaste Hyper Dimensional Lurker

Cool game about a brave rectangle shooting squares to other evil rectangles.

TL:DR

  1. Game 1024x768 30fps
  2. player 200x50 colour: white speed: 6.9pix/frame
  3. enemy 160x160 colour: red speed: 2.56pix/frame
  4. projectile 40x40 colour: yellow speed: 8.5pix/frame

Mechanics


Generals

Game is rendered in real time. So the game proceed even if player is not moving. The illusion of fluid movement is made by high render rate, approx. 30fps with 1024x768 resolution.

The game is preparing every frame of the game state and then displaying it, therefore we need a Update(), and Render() functions. The game state can be changed by enemy movement or player movemnt or shot.

Game gemoetry is represented as the array of coordinates, maybe it's an array of 0 and 1 representing pixels of games. Game movement is represented by changing pixels from on to off.

1. Shooting

Player can shoot the projectile (one at the time - previous projectile needs to disapear to shoot another) on button click. The projectile travels the screen from down to top. Once it hits the enemy or passes the screen height it is removed from game or pooled in location outside the screen.

The speed of projectile: 768/90fps = 8.5 pixels to pass in one frame

2. Movement

Player can move allong bottom boundry of the screen. Its model travels from left to right in 4 seconds so in 120fps. It mustn't pass the vertical boundries of the screen.

Player speed:(1024pix - 200pix)/120fps = 6.9pix to pass in one frame

3. Enemies

Enemies are the only obstacle of the game. They spawn on the top boundry of the screen at random "altitude". The randomness of position is realised by this formula:

(RandomNumber % 768) - 160

Enemies are spawning one at the time. At the enemy kill there is spawned another one. After spawning, the enemy is slowly moving down. When it reach the bottom boundry it "kills the player" and the game is over.

The speed of enemy: 768pix/240fps = 2.56pix to pass in one frame

fpga_vga_rs232_game's People

Contributors

pjedlikowski avatar pjlyoko avatar

Stargazers

 avatar  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.