aboutsummaryrefslogtreecommitdiffstats
path: root/examples/spacewars.cpp
Commit message (Collapse)AuthorAgeFilesLines
* spacewars: cleanup spaceSven Göthel2024-09-141-17/+17
|
* cleanup includes; spacewars: remove wrong castSven Göthel2024-09-141-1/+3
|
* unit: Move literals to namspace pixel::literals (cleanup); Use C++20 numbers ↵v0.9.3Svenson Han Göthel2024-07-141-7/+8
| | | | PI in high resolution
* Merge branch 'master' of ↵Svenson Han Göthel2024-07-141-67/+91
|\ | | | | | | ssh://jordan.goethel.localnet/srv/scm/cs_class/gfxbox2 into lala
| * spacewars: construct HUD text per player ..Sven Göthel2024-07-141-22/+29
| |
| * pixel::init_gfx_subsystem: Return true if successful, otherwise false - ↵Sven Göthel2024-07-141-2/+4
| | | | | | | | don't just exit(1); Also validate sdl_win, sdl_win_id and sdl_rend
| * spacewars: Fix segmentation fault (using nullptr-ship-ref @ pressed-event)Sven Göthel2024-07-131-43/+58
| |
* | spacewars: adjust start posision to geometric ship model(papa chaged ship ↵Svenson Han Göthel2024-07-141-1/+2
|/ | | | model order back)
* spacewars: reorder spaceship design: (1) star trek, (2) klingon, (3) ask my ↵Sven Göthel2024-07-131-3/+3
| | | | son ;-)
* spacewars: Fix & simplify 'mine' / 'orbit' event handling; Simplify ↵Sven Göthel2024-07-131-55/+49
| | | | player_count handling. Setup t1/td post event polling
* Fix: Event handling, don't miss an event: handle_events(..) -> while( ↵Svenson Han Göthel2024-07-111-128/+148
| | | | handle_one_event(..) ) { .. }
* spacewars: add minesSvenson Han Göthel2024-06-151-33/+64
|
* spacewars: make a move funktionSvenson Han Göthel2024-06-121-8/+13
|
* spacewars: make minesSvenson Han Göthel2024-06-121-1/+8
|
* spacewars: Add the 3rd player (P3)Svenson Han Göthel2024-06-121-36/+207
|
* spacewars: Add 10s shield 'cursor down' per shipSvenson Han Göthel2024-04-021-15/+73
|
* WebAssembly: Add interaction: General forced_fps, win_{width,height}; ↵Sven Göthel2024-03-311-16/+15
| | | | | | | | | | freefall01: debug_gfx, rho; spacewars: show_ship_velo wasm exported methods are cwrap'ed in the javascript portion, allowing user interaction. To setup a maximized 16:9 ratio'ed canvas size, JS onRuntimeInitialized() calls JS maximizeCanvas() which propagates the dimenstion to our pixel library via set_window_size(..).
* spacewars, tron: fix typosSven Göthel2024-03-301-3/+3
|
* spacewars, tron: adjust HUD colorSven Göthel2024-03-301-3/+4
|
* tron: Add WebAssembly buildSven Göthel2024-03-301-1/+1
|
* piviz,spacewars: Handle WINDOW_CLOSE_REQ after handle_event()Sven Göthel2024-03-301-4/+2
|
* freefall01: Add WebAssembly buildSven Göthel2024-03-301-13/+7
|
* spacewars: Fix sun size-pump min/maxSven Göthel2024-03-301-3/+8
|
* pixel/pixel2f: Add use_subsys_primitives() notion, i.e. rendering primitives ↵Sven Göthel2024-03-301-2/+15
| | | | (pixel, line) using the gfx-subsystem (SDL, ..) _DEFAULT_ true; spacewars: drop force_fps if use_subsys_primitives()
* spacewars: Disable cloak_enabled by default for game, also not showing ↵Sven Göthel2024-03-291-13/+27
| | | | coordinated in HUD
* Merge branch 'master' into wipSvenson Han Göthel2024-03-291-164/+185
|\
| * spacewars: Center HUD on screen, wasm: use 1024x576 16:9 default resolutionSven Göthel2024-03-291-13/+14
| |
| * Enable WebAssembly (wasm) target via clang + emscripten, initially enable ↵Sven Göthel2024-03-291-177/+201
| | | | | | | | spacewars (WIP, but working demo)
| * C++ cleanup: Add missing override, use 'class' consistently for ↵Sven Göthel2024-03-291-1/+1
| | | | | | | | pixel::f4::vec_t, proper static_cast<decltype(ts.tv_sec)>() for 'struct timespec'.tv_sec
* | spacewars: Various changes..Svenson Han Göthel2024-03-291-32/+27
|/ | | | | | | - fix HUD position, single line HUD - add HUD info - remove level -
* spacewars: make a cloaking device, count score, add player_t handling ↵Svenson Han Göthel2024-03-231-134/+272
| | | | | | | | | | | | spaceship and score... If the boolean from the cloaking device is true, then the spaceship does not draw its body. Otherwise the spaceships' body is drawn. idscore_t covers identity and score, used as a superclass for player_t. The idscore_t reference is passed and stored from player_t to its spaceship_t and its peng_t instances. player_t is-a idscore_t and owns its spaceship, which also controls its peng_t instances.
* spacewars: Have orbit_velocity() chose direction of velocity; Add ↵Sven Göthel2024-03-211-90/+228
| | | | spaceship2; Add 0.25s fuse for peng to arm (not hitting oneself); Add ship/ship and ship/peng collision.
* spacewars: Show target orbit-velocity in debug mode, i.e. helper to gain ↵Sven Göthel2024-03-201-2/+8
| | | | orbit manually
* spacewars: ACTION1 = peng, ACTION2 = set_orbit_velocity()Svenson Han Göthel2024-03-201-10/+1
|
* spacewars: Fix orbit velocity: g = v^2 / dSven Göthel2024-03-201-35/+33
|
* spacewars: Investigate calculating stable orbit parameter: initial-position ↵Svenson Han Göthel2024-03-201-35/+74
| | | | and -velocity
* spacewars: Adjust default values add cmdline-args, debug_gfx; Star gravity ↵Sven Göthel2024-03-201-74/+115
| | | | per ships + fragments; star radius pump 10%; ...
* spacewars: Add star_t w/ gravity impact on spaceshipSvenson Han Göthel2024-03-191-5/+53
|
* spacewars: Fix spaceship_t::peng() velocity of peng_tSvenson Han Göthel2024-03-191-1/+1
|
* spacewars: Add peng_t, use random_device rng for asteroids size, angle, ↵Sven Göthel2024-03-191-97/+190
| | | | velo, start-pos, ...
* pixel::swap_gpu_buffer: Add optional forced fps value, allowing to reduce ↵Svenson Han Göthel2024-03-181-26/+2
| | | | rendering load
* pixel::handle_events(..): Split to handle_one_event() + handle_events() ↵Svenson Han Göthel2024-03-181-29/+18
| | | | while preserving pressed + released key states
* example spacewars: unify astroid into fragment, prepare a bullet (wip)Svenson Han Göthel2024-03-111-294/+114
|
* examples/spacewars: Allow ship to explodeSvenson Han Göthel2024-02-131-10/+20
|
* Example spacewars: Add asteroid and its fragements post collision.Svenson Han Göthel2024-01-251-47/+298
|
* Add example spacewars (WIP)Sven Gothel2023-01-051-0/+422