added demo 7 pong to the repo

This commit is contained in:
ZennDev1337 2023-09-04 09:22:04 +02:00
parent 9b003be2b0
commit 60ecb63360
8 changed files with 28 additions and 30 deletions

14
Cargo.lock generated
View file

@ -72,6 +72,13 @@ dependencies = [
"arduboy-rust",
]
[[package]]
name = "demo7"
version = "0.1.0"
dependencies = [
"arduboy-rust",
]
[[package]]
name = "drboy"
version = "0.1.0"
@ -138,13 +145,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812"
[[package]]
name = "pong"
version = "0.1.0"
dependencies = [
"arduboy-rust",
]
[[package]]
name = "progmem"
version = "0.1.0"

View file

@ -10,7 +10,7 @@ members = [
"Examples/Arduboy-Tutorials/demo4",
"Examples/Arduboy-Tutorials/demo5",
"Examples/Arduboy-Tutorials/demo6",
"Examples/pong",
"Examples/Arduboy-Tutorials/demo7",
"Examples/drboy",
"Examples/rustacean",
"Examples/snake",

View file

@ -1,5 +1,5 @@
[package]
name = "pong"
name = "demo7"
version = "0.1.0"
authors = ["Brian Bowman <seeker14491@gmail.com>"]
license = "MIT OR Apache-2.0"
@ -9,4 +9,4 @@ edition = "2021"
crate-type = ["staticlib"]
[dependencies]
arduboy-rust = { path = "../../arduboy-rust" }
arduboy-rust = { path = "../../../arduboy-rust" }

View file

@ -15,6 +15,10 @@ const arduboy: Arduboy2 = Arduboy2::new();
#[no_mangle]
pub unsafe extern "C" fn setup() {
// put your setup code here, to run once:
arduboy.begin();
arduboy.init_random_seed();
arduboy.set_frame_rate(60);
arduboy.clear();
}
// The loop() function repeats forever after setup() is done
@ -22,4 +26,10 @@ pub unsafe extern "C" fn setup() {
#[export_name = "loop"]
pub unsafe extern "C" fn loop_() {
// put your main code here, to run repeatedly:
if !arduboy.next_frame() {
return;
}
arduboy.clear();
arduboy.display();
}

View file

@ -100,22 +100,6 @@ Windows:
.\run.bat snake
```
### Pong
To upload pong to the Arduboy use:
Linux:
```bash
./run pong
```
Windows:
```ps1
.\run.bat pong
```
### I'm now a Rustacean <3
To upload rustacean to the Arduboy use:
@ -141,7 +125,7 @@ Windows:
- [demo5] [Make Your Own Arduboy Game: Part 5 - Your First Game!](https://community.arduboy.com/t/make-your-own-arduboy-game-part-5-your-first-game/7928)
- [demo6] [Make Your Own Arduboy Game: Part 6 - Graphics!](https://community.arduboy.com/t/make-your-own-arduboy-game-part-6-graphics/7929)
Link for the [arduboy-tile-converter](https://github.com/Team-ARG-Museum/arduboy-tile-converter)
- not done [demo7] [Make Your Own Arduboy Game: Part 7 - Make Pong From Scratch!](https://community.arduboy.com/t/make-your-own-arduboy-game-part-7-make-pong-from-scratch/7930)
- [demo7] [Make Your Own Arduboy Game: Part 7 - Make Pong From Scratch!](https://community.arduboy.com/t/make-your-own-arduboy-game-part-7-make-pong-from-scratch/7930)
- not done [demo8] [Make Your Own Arduboy Game: Part 8 - Starting DinoSmasher](https://community.arduboy.com/t/make-your-own-arduboy-game-part-8-starting-dinosmasher/7932)
- [eeprom] [Help, Im struggling with EEPROM!](https://community.arduboy.com/t/help-im-struggling-with-eeprom/7178)
- [progmem] Usage of the big 28'000 Bytes flash memory for Bitmaps Sound sequeces and Text.
@ -157,6 +141,7 @@ Linux:
./run demo4
./run demo5
./run demo6
./run demo7
./run eeprom
./run eeprom-byte
./run progmem
@ -171,6 +156,7 @@ Windows:
.\run.bat demo4
.\run.bat demo5
.\run.bat demo6
.\run.bat demo7
.\run.bat eeprom
.\run.bat eeprom-byte
.\run.bat progmem

6
run
View file

@ -13,9 +13,6 @@ elif [ "$option" = "doc" ]
then
cargo doc -p arduboy-rust && rm -r ./docs/doc/ && cp -r ./target/arduboy/doc ./docs/
elif [ "$option" = "snake" ]
then
upload
elif [ "$option" = "pong" ]
then
upload
elif [ "$option" = "drboy" ]
@ -49,6 +46,9 @@ elif [ "$option" = "demo5" ]
then
upload
elif [ "$option" = "demo6" ]
then
upload
elif [ "$option" = "demo7" ]
then
upload
else

View file

@ -37,6 +37,8 @@ goto :eof
goto :run
) else if %option%==demo6 (
goto :run
) else if %option%==demo7 (
goto :run
) else (
goto :help
)