Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

159.236 Embedded Programming Assignment 2

Write a simple game for the TTGO T-Display board.

Using PlatformIO and the ESPIDF framework, write a falling block game for the TTGO T-Display board or the emulator.

Use the instructions in Lecture 14 to set up a development environment, you may use the TDisplayGraphics library and can use any of the TTGO Demo code

avalible on github here:

https://github.com/a159x36/TTGODemo

The game must start by showing some instructions, the player should press the left button to start. During the game, the player moves a block (or image) from left to right using the two buttons. The object of the game is to avoid being hit by falling blocks (or images). Initially there will be few blocks and they will fall slowly, over time the number of blocks should increase and they should fall faster. The score must increase by 100 when a block misses the player. When the player is hit by a falling block, the game is over and the score will be displayed. Make sure the score is displayed for a few seconds so that it is visible until the next game is started. The game might look like the image to the right but it doesn’t have to. Make sure you use a hardware timer so that the game runs at the same speed on a real device or the emulator.

If you want to improve the game, you can add a moving background, a high score table, special blocks or use animated images for the blocks.

You can only use C, not C++ and must not use any other framework or library.

You are allowed to use any of the libraries included in the esp-idf and the graphics library. This means using the following #include headers is fine:

graphics.h, fonts.h, stdio.h, stdlib.h, math.h, freertos/FreeRTOS.h, driver/gpio.h, time.h etc..              The main restriction is that you cannot use the arduino framework or a 3rd party library such as lvgl .

This assignment is worth 20% of the final marks

Your assignment will be judged on correctness, style and usability as well as gameplay. Use comments to document your code.

Submit a zip of your project folder (without the files in the .pio or .git directories) electronically from stream. The top level directory in the zip should contain your platformio.ini file.