summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* License under MIT licenseHEADmasterAmin Mesbah2019-06-28
|
* Use a better PiAmin Mesbah2017-12-18
|
* Move vector stuff to it's own filesAmin Mesbah2017-12-18
|
* Make a bunch of stars float aroundAmin Mesbah2017-12-17
| | | | | | | | | | | | I also made the player smaller. Avoiding the stars is fun. I should make a win and lose state based on that, then work on the controls a bit (deadzone, etc.). I'm trying to get used to taking a data-oriented approach. It's tricky to shake the OOP drilled into my brain, but I'm finding it to be a valuable exercise. It certainly makes it easier to not worry about everything being perfect at the very beginning.
* Add ctags file to .gitignoreAmin Mesbah2017-12-17
|
* Negate thrust vectorsAmin Mesbah2017-12-14
|
* Make more terse vector functionsAmin Mesbah2017-12-14
|
* Change vector representationfeatures/vec-structAmin Mesbah2017-12-14
| | | | | | - Use (x,y) rather than (angle, length) - Use a fancy union for convenience - Add some basic vector functions
* Render lines in and between any octantAmin Mesbah2017-12-10
| | | | | | | | | | | | | I did this in the most silly and straightforward way possible. It's begging for some compression. I had to disable the `-Wfloat-equal` compiler argument because it didn't like me comparing floats to 0.0f, which is understandable. However this rendering code will be replaced anyway once I start using Opengl, so being careful with floats doesn't matter too much in this case. However, I really do need to read about floats and how to do safe comparisons...
* Make UPS equal FPS when recording or playing backfeatures/state-loopingAmin Mesbah2017-12-10
| | | | | | | | This makes recorded input played back over an initial state result in a consistent sequence of resulting states every time. This is just temporary. I need to figure out what kind of game loop this game needs. But for now at least playback is consistent.
* Add ability to skip screen clearingAmin Mesbah2017-11-19
| | | | | | | | | - t key toggles 'trace' Note that this exposes the non-determinism of the current game loop. The lag compensation while-loop updates the game state, but not the input. The variance in the number of these updates causes divergent results even when identical input is played over a given initial state.
* Playback recorded input on initial state snapshotAmin Mesbah2017-11-19
|
* Record 10 seconds of input and play it backAmin Mesbah2017-11-19
| | | | | | | - r key toggles input recording - l key toggles looped input playback This was so easy to do!
* Merge branch 'features/live-reload'Amin Mesbah2017-11-12
|\
| * Move linux-specific platform code to util_linux.hfeatures/live-reloadAmin Mesbah2017-11-12
| | | | | | | | | | The plan is to include either util_linux.h or util_windows.h, which each supply platform-specific functions with the same signatures and names.
| * Load game code instantaneously on LinuxAmin Mesbah2017-11-12
| | | | | | | | | | | | | | | | | | | | | | | | Stat is used to read the last modification time of the game.so file. It is loaded if that time is different from the time at last load. This means that it's loaded basically as soon as it's compiled. In the makefile I specified that the game code lib should be compiled to a temp, then copied to the actual .so file. This is because when I tried compiling directly to the .so, the platform would detect the change in the file's modified time, and would try to load it before compilation was complete.
| * Add dynamic reloading of game code on linuxAmin Mesbah2017-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired and informed by Casey Muratori's method in the wonderful Handmade Hero [1]. The the game is compiled into a shared object that is dynamically loaded by the platform layer. There is a way to do this with dlls on windows as well. I had to temporarily remove the `-Wpedantic` compiler flag to stop getting the "ISO C forbids conversion of object pointer to function pointer" error. I'm technically relying on undefined behavior, though in practice it's fine on most modern platforms to cast from a void* to a function pointer. [1] https://hero.handmade.network/episode/code/day021 [2] http://nullprogram.com/blog/2014/12/23/ [3] http://chrismdp.com/2015/08/how-to-add-live-code-reload-to-your-game/
* | Add warning flags to GCCAmin Mesbah2017-11-11
| | | | | | | | | | | | - `-Wfloat-equal`: warn about float equality comparisons - `-Wswitch-enum`: make sure switch statements on enums include a case for every enum code.
* | Prevent unintended double promotionAmin Mesbah2017-11-11
| | | | | | | | | | | | - Append 'f' to intended float literals - Use cosf and sinf() consistently - Double promotion was found with the `Wdouble-promotion` GCC option
* | Use C99 style struct initializationAmin Mesbah2017-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | Safer (initializes struct members to 0) and easier to read. C99 Standard 6.7.8.21: If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration.
* | Wrap player positionAmin Mesbah2017-11-10
|/
* Add visual studio 2017 project filesAmin Mesbah2017-10-30
| | | | SDL 2.0.5 is configured as a nuget dependency.
* Add line and vector rendering functionsAmin Mesbah2017-10-26
|
* Fix hanging bug caused by uninitialized variablesAmin Mesbah2017-10-26
| | | | | | | | | The game would sometimes appear to init and just hang, not processing any new input. This would only happen some of the time. Digging revealed crazy values for the vector lengths and angles. Of course! They were never initialized. Moving the initialization to functions will help prevent this.
* Control two thrust vectorsAmin Mesbah2017-10-24
|
* Fix scary bug caused by uninitialized variablesAmin Mesbah2017-10-24
| | | | Sometimes the axes would start with absurd values.
* Accelerate player with thrust vectorAmin Mesbah2017-10-24
|
* Use optimized binary for `make run`Amin Mesbah2017-10-24
|
* Interpret left thumb stick as a thrust vectorAmin Mesbah2017-10-24
|
* Get controller input through SDL event APIAmin Mesbah2017-10-24
|
* Don't malloc when adding vectorsAmin Mesbah2017-10-23
|
* Move a circle across the screenAmin Mesbah2017-10-17
|
* Render a beautiful black screenAmin Mesbah2017-10-17
Starting with some basic code from previous projects.