Internal DSL for building SDL games #134

Open
kthakore opened this Issue Jul 26, 2011 · 3 comments

Comments

Projects
None yet
1 participant
Owner

kthakore commented Jul 26, 2011

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 was assigned Jul 26, 2011

Owner

kthakore commented Jul 26, 2011

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

Owner

kthakore commented Jul 26, 2011

Author: jamesw
Time: 1279736983
Field: comment
Value:

Owner

kthakore commented Jul 26, 2011

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

A collision plugin would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment