Skip to content

QuocBuu/archery_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archery Game - Build on AK Embedded Base Kit

Gameplay Demo

game_play_video.mp4

Documentation

File Description
README.md Main project overview, hardware information, gameplay rules, and object descriptions.
docs/runtime-signal-processing.md Runtime signal-processing flow for button input, AK task messages, timers, game-loop ticks, object updates, and Mermaid sequence diagrams.
docs/eeprom-data-storage.md EEPROM storage layout for game settings and scores, including magic-number validation, checksum protection, read/write flow, and related APIs.
docs/game-object-sequences.md Runtime sequence diagrams for gameplay objects: Archery, Arrow, Meteoroid, Bang, and Border.
docs/display-design.md Display design notes for screen layout, bitmap assets, rendering flow, and screen transitions.
docs/buzzer-audio.md Buzzer and audio behavior notes for sound effects, silent mode, playback timing, and related APIs.

Introduction

The Archery game is a game running on the AK Embedded Base Kit. It is built to help embedded programming enthusiasts learn and practice event-driven programming. During the development of the archery game, you will learn more about designing and applying UML, Tasks, Signals, Timers, Messages, State-machines,...

I. Hardware

AK Embedded Base Kit - STM32L151 - v3.0

Figure 1: AK Embedded Base Kit - STM32L151

AK Embedded Base Kit is an evaluation kit for advanced embedded software learners.

The KIT integrates 1.54" Oled LCD, 3 push buttons, and 1 Buzzers that play music, to learn the event-driven system through hands-on game machine design. The KIT also integrates RS485, Qwiic Connect System, and Grove Ecosystems, suitable for prototyping practical applications in embedded systems.

MCU Overview:

SoC Name : STM32L151CBT6
RAM      : 16 KB

Flash Partitions Layout
----------------------
[ 0x08000000 - 0x08001FFF ] : Bootloader Partition (8 KB)
=> AK Bootloader

[ 0x08002000 - 0x08002FFF ] : BSF Shared Partition (4 KB)
=> Used for data sharing between Bootloader and Application

[ 0x08003000 - 0x0801FFFF ] : Application Partition (116 KB)
=> Archery Game firmware

MCU Naming Convention:

Part Meaning
STM32 STMicroelectronics 32-bit MCU family.
L Low-power series.
151 STM32L151 product line.
C 48-pin package.
B 128 KB Flash memory.
T LQFP package.
6 Industrial temperature grade.
AK Embedded Base Kit - Board view Top + Bottom

Figure 2: Board view Top + Bottom

II. Game Description and Objects

The following description of the “Archery game”, explains how to play and the game's processing mechanism. This document is used for reference in designing and developing the game later.

menu game

Figure 2: Menu game

The game starts with the Menu game screen with the following options:

  • Archery Game: Select to start the game.
  • Setting: Select to set the game parameters.
  • Charts: Select to view the top 3 highest scores.
  • Exit: Exit the menu to the standby screen.
archery game play screen

Figure 3: Game play screen and objects

Objects in the Game:

Object Name Description
Archery Move up/down to select the position to shoot the arrow
Arrow Shot from the bow, used to destroy meteoroids
Bang Effect that appears when meteoroid is destroyed
Border Safe zone to protect from meteoroids falling into
Meteoroid Object flying towards the bow with increasing speed, capable of destroying the border

Note: For detailed object runtime sequences, see Game Object Sequences.

III. How to Play:

  • In this game, you will control the Archery, move up/down with the [Up]/[Down] buttons, to select the position to shoot the Arrow.
  • When pressing the [Mode] button, the Arrow will be shot, aiming to destroy the incoming Meteoroids.
  • The goal of the game is to get as many points as possible, the game will end when a Meteoroid touches the Border.

Game Mechanics:

  • Scoring: Points are calculated by the number of Meteoroids destroyed. Each destroyed Meteoroid corresponds to 10 points. The accumulated score will be displayed in the bottom right corner of the screen.

  • Difficulty: Every time 200 points are accumulated, the Meteoroid's flying speed will increase by one level. The initial difficulty can be set in the Setting section.

  • Arrow Limit: When shooting, the number of available Arrows will decrease corresponding to the number of flying Arrows, if the available Arrows decrease to "0", you cannot shoot and there will be a warning sound. The number of available Arrows will be restored when a Meteoroid is destroyed or the Arrow flies off the screen. The number of Arrows is displayed in the bottom left corner of the screen and can be changed in the Setting.

  • Animation: To make the game more lively, objects will have additional animation when moving.

  • Game Over: When a Meteoroid touches the Border, the game will end. Objects will be reset and the score will be saved. You will enter the “Game Over” screen with 3 options:

    • Restart: play again.
    • Charts: go to view the leaderboard.
    • Home: back to the game menu.

Note: In the new game version, you will receive a rating from the Mafia Dolphin before entering the Game Over screen, so try to score as many points as possible to earn praise.

archery game over screen 1

Figure 5: Game_over screen 1

archery game over screen 2

Figure 6: Game_over screen 2

IV. Basic Game Sequence Logic

Note: For a more detailed sequence flow, see Runtime Signal Processing.

basic archery game sequence logic

Figure 4: Basic game sequence logic

V. Simulator

Try the game directly in your browser — no hardware required:

▶ Play Web Simulator

Or run it locally on Linux:

cd simulator
make init   # check dependencies
make run    # build and launch

See simulator/README.md for full build instructions (native SDL2 + WebAssembly).

Contact & Support

Phan Quoc Buu - Embedded Software Engineer

Thank you for visiting this repository.  
If you have any questions, suggestions, or feedback about this project or firmware development, feel free to contact me directly

My contact:

About

Archery Game - Build on AK Embedded Base Kit

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors