Difference between revisions of "ECE497 Project LCD Tetris Game"

From eLinux.org
Jump to: navigation, search
m (Future Work)
m (Moved to ECE497Fall2013)
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:ECE497 |Project]]
+
[[Category:ECE497Fall2013 |Project]]
 
{{YoderHead}}
 
{{YoderHead}}
  
Line 28: Line 28:
 
== Executive Summary ==
 
== Executive Summary ==
  
This project builds upon the [http://qt-project.org/doc/qt-4.8/widgets-tetrix.html Qt Tetrix example codé], adding fuctionallity and gameplay to this Tetris-like game.
+
This project builds upon the [http://qt-project.org/doc/qt-4.8/widgets-tetrix.html Qt Tetrix example code], adding fuctionallity and gameplay to this Tetris-like game.
  
 
Features I have added/modified:
 
Features I have added/modified:
1. Added correct Tetris-style keymaps (Z,X,C, Down Arrow, Shift, P)
+
 
 +
1. Added correct Tetris-style keymaps (Z,X,C, Down Arrow, Shift, P), and block colors
 +
 
 
2. Added hold block functionality from pressing shift.  
 
2. Added hold block functionality from pressing shift.  
 +
 
3. Added correct level progression criteria.
 
3. Added correct level progression criteria.
  
 
Features looking to add:
 
Features looking to add:
1. Music over PWM channels
+
 
 +
1. Tetris Theme.
 +
 
 
2. Animations when line clear and Tetrises occur.
 
2. Animations when line clear and Tetrises occur.
 +
 
3. Ghost Block (?)
 
3. Ghost Block (?)
  
Line 46: Line 52:
 
== Installation Instructions ==
 
== Installation Instructions ==
  
Give step by step instructions on how to install your project.   
+
This project requires Qt to build and Qt Embedded to build the Beagle as a target.
 +
 
 +
*Although Qt is easily to use, and apps are quite intuitive to develop, setup for embedded Linux is an uphill battle
 +
:* If you want to develop an app quickly,
 +
  sudo apt-get install qtcreator
 +
  (will get you running and developing apps on your host in no time)
 +
* I have not yet gotten my libraries to work, but below are some steps gathered from handful of hours of research.
 +
 
 +
* If you do not have a toolchain, install it. Angrstom's is here ( [http://www.angstrom-distribution.org/simplified-development-setup Angstrom])
 +
* Download the Qt libraries (4.8) ([http://qt-project.org/downloads Qt's Webpage])
 +
* See [http://qt-project.org/wiki/Building_Qt_for_Embedded_Linux Building_Qt_for_Embedded_Linux] 
 +
  Modify a qmake.conf to fit that of your toolchain 
 +
  (qt-everywhwere-opensouce-directory)/mkspecs/qws/linux-arm-gnueabi-g++/:$ gedit qmake.conf
 +
  or add your own in
 +
  (qt-everywhere-opensouce-directory)/mkspecs/qws/YOUR-TOOL-CHAIN/:$ touch qmake.conf
 +
 
 +
* Config for Host:
 +
  cd (qt-everywhere-opensource-directory)
 +
  host:(qt-e-o-d)$ ./configure -prefix /usr/local/qtHost \
 +
  -embedded -qt-gfx-linuxfb -qt-gfx-qvfb \
 +
  -qt-gfx-vnc -no-largefile -exceptions -no-accessibility \
 +
  -no-qt3support -qt-zlib -no-gif -no-libtiff \
 +
  -qt-libpng -no-libmng -qt-libjpeg \
 +
  -openssl -no-nis -no-cups -depths 8,16,18,32 \
 +
  -qt-kbd-tty -qt-kbd-qvfb -qt-kbd-linuxinput \
 +
  -qt-mouse-linuxinput -qt-mouse-qvfb -qt-mouse-pc \
 +
  -no-javascript-jit -no-webkit \
 +
  -opensource  -confirm-license -v
 +
 
 +
* Config for Target:
 +
  cd (qt-everywhere-opensource-directory)
 +
  host:(qt-e-o-d)$ ./configure -xplatform qws/linux-arm-gnueabi-g++ -embedded arm \
 +
  -prefix /usr/local/qtTarget \
 +
  -qt-gfx-linuxfb -qt-gfx-vnc \
 +
  -no-largefile -exceptions -no-accessibility -no-qt3support -no-sse2 -qt-zlib -no- gif -no-libtiff \
 +
  -qt-libpng -no-libmng -qt-libjpeg -openssl -no-nis -no-cups -depths 16 \
 +
  -qt-kbd-linuxinput -nomake demos -nomake examples \
 +
  -qt-mouse-linuxinput -little-endian \
 +
  -no-javascript-jit -no-webkit -no-pch\
 +
  -opensource -confirm-license -v
 +
 
 +
* '''!!!! Note !!!!''' You may need to resolve any unmet dependencies, not limited to but including: those related to GStreamer ( libgstreamer0.10-0, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-0, libgstreamer-plugins-base0.10-dev), OpenGL (libegl1-mesa-dev, )
  
 
* Include your [https://github.com/ github] path as a link like this to the read-only git site:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  
 
* Include your [https://github.com/ github] path as a link like this to the read-only git site:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  
 +
 
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
 
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
 +
 
* Include a Makefile for you code.
 
* Include a Makefile for you code.
* Include any additional packages installed via '''opkg'''.
+
 
* Include kernel mods.
+
* Miscelaneous Links:
* If there is extra hardware needed, include links to where it can be obtained.
+
:* These over simplify the process, but they are official: [http://qt-project.org/doc/qt-4.8/qt-embedded-crosscompiling.html Cross-Compiling Qt for Embedded Linux Apps], [http://qt-project.org/doc/qt-4.8/qt-embedded-linux.html Qt For Embedded linux]
  
 
== User Instructions ==
 
== User Instructions ==
  
 
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
 
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
 +
 +
 +
Press {Start} to start play
 +
 +
*Key Map
 +
 +
*SHIFT = Hold  (only oncece per drop)
 +
*Z = Rotates piece counter-clockwise
 +
*X = Rotates piece clockwise
 +
*SPACE = Hard drop piece
 +
*ARROW_L =  Move left
 +
*ARROW_R =  Move right
 +
*ARROW_D = Soft Drop
 +
*ARROW_U = Rotate Clockwise
 +
*P  = Pause
  
 
== Highlights ==
 
== Highlights ==
Line 67: Line 131:
 
== Theory of Operation ==
 
== Theory of Operation ==
  
Give a high level overview of the structure of your software. Are you using GStreamer?  Show a diagram of the pipeline. Are you running multiple tasks?  Show what they do and how they interact.
+
Qt is a C++ development framework specializing in allowing for quick GUI development.
 +
 
 +
 
 +
Qt applications need a Qt server to be running in order to function properly. Luckily, any application can function as a Qt server, so a single application can be standalone, on a device that has Qt libraries properly setup. Similarly, other multiple applications can connect to the same server, receive input, and send output.
 +
 
 +
A positive for embedded programming is that Qt applications can write directly to the frame buffer, so no other graphical utilities have to be running in order to display an application properly. Therefore less overhead is necessary as you wouldn't need to run gnome, xfce, or a similar graphical interface.
  
== Work Breakdown ==
+
Qt runs on many platforms, though the main design flow is based around setting a a host environment on which you can cross-compile applications for a target. This target must be able to run Qt libraries, which also need to be cross compiled. With this setup, one can deploy the application from the host to the target, and run the application natively on the target.
  
List the major tasks in your project and who did what.
+
== Major Tasks ==
  
-Implement Tetris Game
 
  
-Display On LCD with Qt
 
  
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
  -Implement Tetris Game, in my case I used the Tetrix Sample from Qt and added functionality to it.
 +
  '''Setup the BBB to properly run Qt Aplications'''
 +
  -Setup cross compiler on host for BBB linux distribution.
 +
  -Cross compile the Qt libraries for the BBB on Host
 +
  -Cross compile the Qt app
 +
  -Deploy libraries and application on host
  
 
== Future Work ==
 
== Future Work ==

Latest revision as of 05:42, 14 October 2014

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Alex Alvarez

Grading Template

I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

00 Executive Summary
00 Installation Instructions 
00 User Instructions
00 Highlights
00 Theory of Operation
00 Work Breakdown
00 Future Work
00 Conclusions
00 Demo
00 Late
Comments: I'm looking forward to seeing this.

Score:  10/100

(Inline Comment)

Executive Summary

This project builds upon the Qt Tetrix example code, adding fuctionallity and gameplay to this Tetris-like game.

Features I have added/modified:

1. Added correct Tetris-style keymaps (Z,X,C, Down Arrow, Shift, P), and block colors

2. Added hold block functionality from pressing shift.

3. Added correct level progression criteria.

Features looking to add:

1. Tetris Theme.

2. Animations when line clear and Tetrises occur.

3. Ghost Block (?)

Packaging

If you have hardware, consider Small Build, Big Execuition for ideas on the final packaging.

Installation Instructions

This project requires Qt to build and Qt Embedded to build the Beagle as a target.

  • Although Qt is easily to use, and apps are quite intuitive to develop, setup for embedded Linux is an uphill battle
  • If you want to develop an app quickly,
  sudo apt-get install qtcreator
  (will get you running and developing apps on your host in no time)
  • I have not yet gotten my libraries to work, but below are some steps gathered from handful of hours of research.
  Modify a qmake.conf to fit that of your toolchain  
  (qt-everywhwere-opensouce-directory)/mkspecs/qws/linux-arm-gnueabi-g++/:$ gedit qmake.conf
  or add your own in 
  (qt-everywhere-opensouce-directory)/mkspecs/qws/YOUR-TOOL-CHAIN/:$ touch qmake.conf
  • Config for Host:
  cd (qt-everywhere-opensource-directory)
  host:(qt-e-o-d)$ ./configure -prefix /usr/local/qtHost \
  -embedded -qt-gfx-linuxfb -qt-gfx-qvfb \
  -qt-gfx-vnc -no-largefile -exceptions -no-accessibility \
  -no-qt3support -qt-zlib -no-gif -no-libtiff \
  -qt-libpng -no-libmng -qt-libjpeg \
  -openssl -no-nis -no-cups -depths 8,16,18,32 \
  -qt-kbd-tty -qt-kbd-qvfb -qt-kbd-linuxinput \
  -qt-mouse-linuxinput -qt-mouse-qvfb -qt-mouse-pc \
  -no-javascript-jit -no-webkit \
  -opensource  -confirm-license -v
  • Config for Target:
  cd (qt-everywhere-opensource-directory)
  host:(qt-e-o-d)$ ./configure -xplatform qws/linux-arm-gnueabi-g++ -embedded arm \
  -prefix /usr/local/qtTarget \
  -qt-gfx-linuxfb -qt-gfx-vnc \
  -no-largefile -exceptions -no-accessibility -no-qt3support -no-sse2 -qt-zlib -no-  gif -no-libtiff \
  -qt-libpng -no-libmng -qt-libjpeg -openssl -no-nis -no-cups -depths 16 \
  -qt-kbd-linuxinput -nomake demos -nomake examples \
  -qt-mouse-linuxinput -little-endian \
  -no-javascript-jit -no-webkit -no-pch\
  -opensource -confirm-license -v
  • !!!! Note !!!! You may need to resolve any unmet dependencies, not limited to but including: those related to GStreamer ( libgstreamer0.10-0, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-0, libgstreamer-plugins-base0.10-dev), OpenGL (libegl1-mesa-dev, )
  • Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
  • Include a Makefile for you code.
  • Miscelaneous Links:

User Instructions

Once everything is installed, how do you use the program? Give details here, so if you have a long user manual, link to it here.


Press {Start} to start play

  • Key Map
  • SHIFT = Hold (only oncece per drop)
  • Z = Rotates piece counter-clockwise
  • X = Rotates piece clockwise
  • SPACE = Hard drop piece
  • ARROW_L = Move left
  • ARROW_R = Move right
  • ARROW_D = Soft Drop
  • ARROW_U = Rotate Clockwise
  • P = Pause

Highlights

Here is where you brag about what your project can do.

Include a YouTube demo.

Theory of Operation

Qt is a C++ development framework specializing in allowing for quick GUI development.


Qt applications need a Qt server to be running in order to function properly. Luckily, any application can function as a Qt server, so a single application can be standalone, on a device that has Qt libraries properly setup. Similarly, other multiple applications can connect to the same server, receive input, and send output.

A positive for embedded programming is that Qt applications can write directly to the frame buffer, so no other graphical utilities have to be running in order to display an application properly. Therefore less overhead is necessary as you wouldn't need to run gnome, xfce, or a similar graphical interface.

Qt runs on many platforms, though the main design flow is based around setting a a host environment on which you can cross-compile applications for a target. This target must be able to run Qt libraries, which also need to be cross compiled. With this setup, one can deploy the application from the host to the target, and run the application natively on the target.

Major Tasks

  -Implement Tetris Game, in my case I used the Tetrix Sample from Qt and added functionality to it.
  Setup the BBB to properly run Qt Aplications
  -Setup cross compiler on host for BBB linux distribution.
  -Cross compile the Qt libraries for the BBB on Host
  -Cross compile the Qt app
  -Deploy libraries and application on host

Future Work

Multiplayer Game mode that displays a small version of other people's games in a small frame on the side.

Conclusions

Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.




thumb‎ Embedded Linux Class by Mark A. Yoder