Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Randomize start position/direction #3

Open
Hpmason opened this issue Jul 11, 2021 · 0 comments
Open

Randomize start position/direction #3

Hpmason opened this issue Jul 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Hpmason
Copy link
Owner

Hpmason commented Jul 11, 2021

The start position/direction are hard coded in main.rs

gba-dvd/src/main.rs

Lines 70 to 71 in e641f19

let mut x_dir = Direction::RIGHT;
let mut y_dir = Direction::UP;

gba-dvd/src/main.rs

Lines 73 to 74 in e641f19

// Size should be 64x48 (from top left), but takes up a full 64x64 sprite
let mut dvd_obj = Obj::new(40, 30, 64, 48);

^ position (40, 30)

Possible ways to randomize this include:

  • Each time the game boots, save a randomly generated value to a save file. On boot, we can use that value as the starting seed.
    • Each load will be randomized
  • Use RTC (Real Time Clock) as starting seed
    • Therefore the starting values will also be randomized and not determined by the previous iteration of the game
    • While this is the nice way to randomize this, it will not work any flashcards without a RTC component
@Hpmason Hpmason added the enhancement New feature or request label Jul 11, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant