summaryrefslogtreecommitdiff
path: root/2d/game.scm
Commit message (Collapse)AuthorAgeFilesLines
* Change tick-agenda! and clear-agenda! to take agenda as arg.David Thompson2014-01-101-3/+2
| | | | | | * 2d/agenda.scm (tick-agenda!, clear-agenda!): Add agenda param. * 2d/game.scm (update, tick): Update usage of tick-agenda!.
* Fix crash when handling an SDL event.David Thompson2014-01-091-1/+1
| | | | * 2d/game.scm (handle-event): Fix bug.
* Add paused-agenda.David Thompson2014-01-091-1/+7
| | | | | * 2d/game.scm (paused-agenda): New variable. (tick): Tick paused-agenda.
* Factor REPL out of main loop.David Thompson2014-01-091-31/+0
| | | | | | | | | * 2d/game.scm (start-game-loop): Don't spawn REPL. (update-and-render, tick): Don't run REPL. (run-repl-thunk, run-repl): Move. * 2d/repl/repl.scm: (run-repl-thunk, flush-repl): Add. (flush-repl): Schedule REPL to be run within main loop.
* Move FPS to a module and add accumulator parameter.David Thompson2014-01-091-57/+30
| | | | | | | | | * 2d/game.scm (accumulator): New parameter. (draw-hook): Change to arity 2. (current-fps, accumulate-fps!, game-fps): Delete. (game-loop, update-and-render): Drop accumulator formal parameter. * 2d/fps.scm: New module.
* Tweak SDL event handling.David Thompson2014-01-071-11/+10
| | | | | | * 2d/game.scm (handle-events, read-input): Rename it. (event-handlers, register-event-handler, handle-event): Use a hash table instead of an alist.
* Make game loop status parameter.David Thompson2014-01-071-9/+9
| | | | | | | | * 2d/game.scm (%state): Replace with game-loop-status. (game-loop-status): New parameter. (run-game-loop): Set status to running. (game-running?, game-paused?, pause-game, resume-game, quit-game): Use parameter.
* Make tick-interval a parameter.David Thompson2014-01-071-11/+13
| | | | | * 2d/game.scm (run-game-loop): Compute tick-interval. (update, update-and-render, tick): Use tick-interval parameter.
* Add draw-hook.David Thompson2014-01-071-13/+6
| | | | | | | * 2d/game.scm (run-game, run-game-loop): Rename and remove draw callback parameter. (draw-hook): New hook. (draw): Run draw hook.
* Restructure game callbacks and signals.David Thompson2013-12-151-11/+7
| | | | | | | | * 2d/game.scm (game-draw): Add signal. (run-game): Remove update callback. (draw): Use alpha value. (update): Remove call to obsolete update callback. (update-and-render): Pass alpha value.
* Move event handlers and signals into their own modules.David Thompson2013-12-011-70/+9
| | | | | | | | | | | * 2d/game.scm (register-event-handler): New procedure. (mouse-*, key-*, window-*): Remove signals. * 2d/window.scm (window-size): New signal. * 2d/mouse.scm: New module. * 2d/keyboard.scm: New module.
* Add key-directions and key-wasd procedures.David Thompson2013-12-011-11/+17
| | | | | * 2d/game.scm (key-directions, key-wasd): New procedures. (arrows, key-arrows): Renamed.
* Make signal transformer an optional keyword argument.David Thompson2013-12-011-4/+4
| | | | | | * 2d/signals.scm (make-signal): Make transformer optional. (signal-identity): Delete it. (signal-*): Use new constructor.
* Add arrows signal.David Thompson2013-12-011-0/+12
| | | | * 2d/game.scm (arrows): New signal.
* Refactor game loop code and improve event signals.David Thompson2013-12-011-110/+96
| | | | * 2d/game.scm: New signals and refactor.
* Add with-window form.David Thompson2013-11-301-18/+7
| | | | | | | | | * 2d/window.scm (<window>): New record type. (open-window): Use window object. (close-window): Change docstring. * 2d/game.scm (<game>, make-game): Remove window properties. (run-game): Remove window logic.
* Remove stage stuff from game module and use signals.David Thompson2013-11-301-71/+74
| | | | Moving my work to another machine so this commit is ugly.
* Merge game-loop module with game module.David Thompson2013-11-041-3/+240
|
* Use the new scene/stage API.David Thompson2013-10-231-76/+19
|
* Re-export new procedures from game-loop module.David Thompson2013-10-231-0/+5
|
* Add a paused flag in addition to the running flag.David Thompson2013-10-231-2/+2
|
* Rename scene draw and update procedures.David Thompson2013-09-151-2/+2
| | | | They were inconsistent with the rest of the API.
* Export current-fps from game module.David Thompson2013-09-081-1/+2
|
* Create a scene stack interface.David Thompson2013-09-061-1/+4
|
* Create copies of the default events alist for safety.David Thompson2013-09-061-2/+5
|
* Prevent circular dependency by moving core game data structures to another ↵David Thompson2013-09-061-27/+57
| | | | module.
* Add a *running* flag to the game loop.David Thompson2013-09-061-10/+15
|
* Create (2d game) module.David Thompson2013-09-061-0/+66