PerlGameDev / SDL

Rehashing the old perl SDL binding on cpan.org
http://search.cpan.org/dist/SDL
GNU General Public License v2.0
81 stars 29 forks source link

Internal DSL for building SDL games #134

Open kthakore opened 13 years ago

kthakore commented 13 years ago

Create an SDLx::Builder module to create SDL games declaratively, similar in idea to Plack::Builder for laying out websites. Syntax something like this:

SDL { title => 'My Game', dimensions => [640,480], depth => 32, scenes => { scene { name => 'Map1', image => 'map1.jpg', }, scene { name => 'Map2', image => 'map2.jpg', }, }, sprites => { sprite { name => 'actor1', rect => [0, 0, 80, 80] sequence 'walk' => [ [0], [0..7] ], sequence 'run' => [ [0], [8..15] ], } }, texts => { text 'gameover' => { font => 'bold', color => 'red', string => 'Game Over!', position => [15,15], }, }, events => { event 'playerdies' => { displaytext 'gameover' wait; endgame; } } };

kthakore commented 13 years ago

Author: jamesw Time: 1279736983 Field: status Value: accepted

kthakore commented 13 years ago

Author: jamesw Time: 1279736983 Field: comment Value:

kthakore commented 13 years ago

Author: kthakore Time: 1279737992 Field: comment Value: Scenes, will be SDLx::Map, and SDLx::LayerManager

A collision plugin would be nice.