summaryrefslogtreecommitdiff
path: root/2d/game.scm
Commit message (Collapse)AuthorAgeFilesLines
* Remove the accumulator parameter from the game loop.David Thompson2014-04-231-40/+19
| | | | | | | * 2d/game.scm (accumulator, update-and-render, tick) Delete. (run-game-loop): Remove accumulator parameterization. (game-loop): Use lag variable instead of accumulator. (update, alpha): Add lag as formal parameter.
* Replace figl with the new guile-opengl official release.David Thompson2014-03-231-1/+1
|
* Okay, I think I finally got all of the license headers updated.David Thompson2014-03-101-8/+8
|
* Import new signal moduleDavid Thompson2014-02-171-1/+1
| | | | | | * 2d/font.scm: Import (2d signal). * 2d/game.scm: Import (2d signal). * 2d/sprite.scm: Import (2d signal).
* Remove calls that change OpenGL matrix mode.David Thompson2014-02-161-6/+1
| | | | * 2d/game.scm (draw): Remove matrix mode calls.
* Remove silly circular import.David Thompson2014-02-091-1/+0
| | | | * 2d/game.scm: Don't import (2d game), silly.
* Remove dynamic scoping of agendas.David Thompson2014-02-061-1/+3
| | | | | | | | | | | | | | | | * 2d/agenda.scm: (*global-agenda*, current-agenda, with-agenda): Delete. (agenda?, agenda-time): Export. (schedule-every, schedule-each): Rename schedule-every to schedule-each. (schedule-next): Delete. * 2d/game.scm: (game-agenda): New variable. (update): Tick game-agenda. * 2d/repl.scm: Use new agenda API. * 2d/sprite.scm: Use new agenda API. * 2d/time.scm: (time-every, time-each, time-delay): Change signature and use new agenda API. * examples/coroutine.scm: Use new agenda API. * examples/particles.scm: Use new agenda API.
* Remove unused import declarations.David Thompson2014-01-261-2/+0
| | | | * 2d/game.scm: Remove (2d coroutine) and (2d vector2) imports.
* Move OpenGL viewport settings to game module.David Thompson2014-01-261-0/+7
| | | | | | * 2d/window.scm (open-window): Remove viewport config. * 2d/game.scm (draw): Add viewport config.
* Move SDL event handling to a separate module.David Thompson2014-01-261-25/+3
| | | | | | | | | | | | * 2d/event.scm: New module. * 2d/game.scm: Remove event handling code. * 2d/keyboard.scm: Import (2d event) instead of (2d game). * 2d/mouse.scm: Import (2d event) instead of (2d game). * 2d/window.scm: Import (2d event) instead of (2d game).
* 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