Player 1 (LV2)
![Untitled design.png](/proxy/?url=https://content.instructables.com/FQI/BP6U/KW6E992U/FQIBP6UKW6E992U.png&filename=Untitled design.png)
![Player 1](/proxy/?url=https://content.instructables.com/FXX/WIV8/KW6E991D/FXXWIV8KW6E991D.jpg&filename=Player 1)
In this tutorial, you will create a basic moving player character on your LED matrix.
The character (dot) will be controlled by the 4 buttons.
You can use this tutorial as the base for a video game.
Supplies
![Screen Shot 2021-11-16 at 9.19.47 PM.png](/proxy/?url=https://content.instructables.com/F6Q/2XOD/KW6E990V/F6Q2XODKW6E990V.png&filename=Screen Shot 2021-11-16 at 9.19.47 PM.png)
- TekTech RC1 + USB wire
- Download APP (Windows Only)
Imagine It
The character has to move freely in all directions, in all spaces, but should always appear on display.
Our display is 8 x 16. which means that our player can only move within 8 vertical spaces (Y-Axis) and 16 horizontal spaces (X-axis).
- The visible Y-axis spreads between 0 and 15
- The visible X-axis spreads between 0 and 7
- (0,0) is at the top left corner
- We have 4 directions(up,down,right,left).
Let's look at a pseudocode example: When pressing button B1, move right
pseudocode: While I am pressing button B ----> +1 to the Y-axis.
NB: Make sure the number is not more than 15 when adding that +1
Code
![Screen Shot 2021-11-19 at 4.06.47 PM.png](/proxy/?url=https://content.instructables.com/FM0/SJ2O/KW6E98M6/FM0SJ2OKW6E98M6.png&filename=Screen Shot 2021-11-19 at 4.06.47 PM.png)
This is the code for the pseudocode mentioned in step 1
Task: Create the 3 other directions
Test It
Press B1. Do you see the dot moving?
Is it moving as you expected?
Reflect on It
Can you create another character?
Can this character interact with your character? maybe a friend or a monster character.
Can you create a game environment?
Can you add music from the buzzer?