added demo 7 pong to the repo
This commit is contained in:
parent
9b003be2b0
commit
60ecb63360
8 changed files with 28 additions and 30 deletions
14
Cargo.lock
generated
14
Cargo.lock
generated
|
@ -72,6 +72,13 @@ dependencies = [
|
||||||
"arduboy-rust",
|
"arduboy-rust",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "demo7"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"arduboy-rust",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "drboy"
|
name = "drboy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -138,13 +145,6 @@ version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812"
|
checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pong"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"arduboy-rust",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "progmem"
|
name = "progmem"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
@ -10,7 +10,7 @@ members = [
|
||||||
"Examples/Arduboy-Tutorials/demo4",
|
"Examples/Arduboy-Tutorials/demo4",
|
||||||
"Examples/Arduboy-Tutorials/demo5",
|
"Examples/Arduboy-Tutorials/demo5",
|
||||||
"Examples/Arduboy-Tutorials/demo6",
|
"Examples/Arduboy-Tutorials/demo6",
|
||||||
"Examples/pong",
|
"Examples/Arduboy-Tutorials/demo7",
|
||||||
"Examples/drboy",
|
"Examples/drboy",
|
||||||
"Examples/rustacean",
|
"Examples/rustacean",
|
||||||
"Examples/snake",
|
"Examples/snake",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pong"
|
name = "demo7"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Brian Bowman <seeker14491@gmail.com>"]
|
authors = ["Brian Bowman <seeker14491@gmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
@ -9,4 +9,4 @@ edition = "2021"
|
||||||
crate-type = ["staticlib"]
|
crate-type = ["staticlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arduboy-rust = { path = "../../arduboy-rust" }
|
arduboy-rust = { path = "../../../arduboy-rust" }
|
|
@ -15,6 +15,10 @@ const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn setup() {
|
pub unsafe extern "C" fn setup() {
|
||||||
// put your setup code here, to run once:
|
// 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
|
// The loop() function repeats forever after setup() is done
|
||||||
|
@ -22,4 +26,10 @@ pub unsafe extern "C" fn setup() {
|
||||||
#[export_name = "loop"]
|
#[export_name = "loop"]
|
||||||
pub unsafe extern "C" fn loop_() {
|
pub unsafe extern "C" fn loop_() {
|
||||||
// put your main code here, to run repeatedly:
|
// put your main code here, to run repeatedly:
|
||||||
|
if !arduboy.next_frame() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
arduboy.clear();
|
||||||
|
|
||||||
|
arduboy.display();
|
||||||
}
|
}
|
||||||
|
|
20
README.md
20
README.md
|
@ -100,22 +100,6 @@ Windows:
|
||||||
.\run.bat snake
|
.\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
|
### I'm now a Rustacean <3
|
||||||
|
|
||||||
To upload rustacean to the Arduboy use:
|
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)
|
- [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)
|
- [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)
|
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)
|
- 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, I’m struggling with EEPROM!](https://community.arduboy.com/t/help-im-struggling-with-eeprom/7178)
|
- [eeprom] [Help, I’m 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.
|
- [progmem] Usage of the big 28'000 Bytes flash memory for Bitmaps Sound sequeces and Text.
|
||||||
|
@ -157,6 +141,7 @@ Linux:
|
||||||
./run demo4
|
./run demo4
|
||||||
./run demo5
|
./run demo5
|
||||||
./run demo6
|
./run demo6
|
||||||
|
./run demo7
|
||||||
./run eeprom
|
./run eeprom
|
||||||
./run eeprom-byte
|
./run eeprom-byte
|
||||||
./run progmem
|
./run progmem
|
||||||
|
@ -171,6 +156,7 @@ Windows:
|
||||||
.\run.bat demo4
|
.\run.bat demo4
|
||||||
.\run.bat demo5
|
.\run.bat demo5
|
||||||
.\run.bat demo6
|
.\run.bat demo6
|
||||||
|
.\run.bat demo7
|
||||||
.\run.bat eeprom
|
.\run.bat eeprom
|
||||||
.\run.bat eeprom-byte
|
.\run.bat eeprom-byte
|
||||||
.\run.bat progmem
|
.\run.bat progmem
|
||||||
|
|
6
run
6
run
|
@ -13,9 +13,6 @@ elif [ "$option" = "doc" ]
|
||||||
then
|
then
|
||||||
cargo doc -p arduboy-rust && rm -r ./docs/doc/ && cp -r ./target/arduboy/doc ./docs/
|
cargo doc -p arduboy-rust && rm -r ./docs/doc/ && cp -r ./target/arduboy/doc ./docs/
|
||||||
elif [ "$option" = "snake" ]
|
elif [ "$option" = "snake" ]
|
||||||
then
|
|
||||||
upload
|
|
||||||
elif [ "$option" = "pong" ]
|
|
||||||
then
|
then
|
||||||
upload
|
upload
|
||||||
elif [ "$option" = "drboy" ]
|
elif [ "$option" = "drboy" ]
|
||||||
|
@ -49,6 +46,9 @@ elif [ "$option" = "demo5" ]
|
||||||
then
|
then
|
||||||
upload
|
upload
|
||||||
elif [ "$option" = "demo6" ]
|
elif [ "$option" = "demo6" ]
|
||||||
|
then
|
||||||
|
upload
|
||||||
|
elif [ "$option" = "demo7" ]
|
||||||
then
|
then
|
||||||
upload
|
upload
|
||||||
else
|
else
|
||||||
|
|
2
run.bat
2
run.bat
|
@ -37,6 +37,8 @@ goto :eof
|
||||||
goto :run
|
goto :run
|
||||||
) else if %option%==demo6 (
|
) else if %option%==demo6 (
|
||||||
goto :run
|
goto :run
|
||||||
|
) else if %option%==demo7 (
|
||||||
|
goto :run
|
||||||
) else (
|
) else (
|
||||||
goto :help
|
goto :help
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue