thetawavegame / thetawave

A physics based, space shooter game made with Rust and the Bevy engine.
https://thetawave.metalmancy.tech
MIT License
163 stars 9 forks source link

Persist user specific stats like games played and total enemies killed #58

Closed varoonp123 closed 1 year ago

varoonp123 commented 1 year ago

in a local sqlite. Along the way, we refactored arcade+db functionality into separate crates/compilation units to assist platform-specific feature development+conditional compilation.
Screenshot from 2023-08-01 02-23-23

Some help with layout and styling would be appreciated.

varoonp123 commented 1 year ago

The problem is that sqlite (in C) uses stdio.h and we don't have that in the browser. turns out this isnt so easy since sqlite is all about synchronous IO which doesnt go so well in the browser, especially since we also need to compile audio stuff to JS. so ill conditionally compile out the db stuff and the current game metrics are all we get in the browser for now.

I also tried with wasm32-wasi and wasm32-emscripten targets.

varoonp123 commented 1 year ago

I busted out some big guns for some large scale refactoring (IntelliJ can do things that neovim can only dream of). Copying and pasting is for poor people, with this many modules.

We might as well also move the arcade module to a crate so that it can have its own modules and get more complex if needed.

cdsupina commented 1 year ago

First time I ran Thetawave on Windows with the "storage" feature. I had this error appear. Reporting to you as directed in the message 👍 Screenshot 2023-08-03 101753

cdsupina commented 1 year ago

The "Games Lost" stat seems off. Screenshot 2023-08-03 102019

cdsupina commented 1 year ago

The "Games Lost" stat seems off. Screenshot 2023-08-03 102019

The next game I played it was in the 20000's.

varoonp123 commented 1 year ago

Both of those errors were caused by me setting the wrong schedule for the system that increments those counters. Fixed 4aa65dd

cdsupina commented 1 year ago

After running my branch a few times (using the storage feature) after pulling your changes, it looks like the "games lost" isn't being properly saved in the database. It resets every time I re-run the game.

cdsupina commented 1 year ago

There seems to be a typo in some of the SQL code. Screenshot 2023-08-03 204255