- Moviment
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "jgame.h"
|
||||
#include "jdraw.h"
|
||||
#include "jinput.h"
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
draw::surface *surf;
|
||||
|
||||
@@ -11,9 +13,13 @@ void game::init()
|
||||
draw::loadPalette("test.gif");
|
||||
}
|
||||
|
||||
int sx=1, sy=0;
|
||||
|
||||
bool game::loop()
|
||||
{
|
||||
draw::cls(0);
|
||||
if (input::keyDown(SDL_SCANCODE_LEFT)) sx++;
|
||||
|
||||
draw::cls(8);
|
||||
for (int y=0;y<8;++y)
|
||||
{
|
||||
for (int x=0;x<8;++x)
|
||||
@@ -21,6 +27,7 @@ bool game::loop()
|
||||
draw::draw(148+x*12-y*12,80+x*6+y*6,24,11,0,13);
|
||||
}
|
||||
}
|
||||
draw::draw(148+sx*2-sy*2, 68+sx+sy,24,24,24,0);
|
||||
draw::render();
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user