Everything works now ! Thank you Lephé ! Started fixing sprite alpha. Need to reconvert them with sprite coder ...
BIN
Realite.g1a
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 238 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 241 B |
|
@ -8,5 +8,6 @@ with Image.open(sys.argv[1]) as im:
|
|||
pixels = rgb_im.load()
|
||||
for y in range(rgb_im.size[1]):
|
||||
for x in range(rgb_im.size[0]):
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (255, 255, 255, 255)
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (0, 0, 0, 255)
|
||||
else: pixels[x, y] = (255, 255, 255, 255)
|
||||
rgb_im.save("a"+str(i)+".png")
|
||||
|
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 291 B |
|
@ -8,5 +8,6 @@ with Image.open(sys.argv[1]) as im:
|
|||
pixels = rgb_im.load()
|
||||
for y in range(rgb_im.size[1]):
|
||||
for x in range(rgb_im.size[0]):
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (255, 255, 255, 255)
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (0, 0, 0, 255)
|
||||
else: pixels[x, y] = (255, 255, 255, 255)
|
||||
rgb_im.save("a"+str(i)+".png")
|
||||
|
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 238 B After Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 238 B After Width: | Height: | Size: 254 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 249 B |
|
@ -8,5 +8,6 @@ with Image.open(sys.argv[1]) as im:
|
|||
pixels = rgb_im.load()
|
||||
for y in range(rgb_im.size[1]):
|
||||
for x in range(rgb_im.size[0]):
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (255, 255, 255, 255)
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (0, 0, 0, 255)
|
||||
else: pixels[x, y] = (255, 255, 255, 255)
|
||||
rgb_im.save("a"+str(i)+".png")
|
||||
|
|
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 304 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 297 B |
|
@ -8,5 +8,6 @@ with Image.open(sys.argv[1]) as im:
|
|||
pixels = rgb_im.load()
|
||||
for y in range(rgb_im.size[1]):
|
||||
for x in range(rgb_im.size[0]):
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (255, 255, 255, 255)
|
||||
if pixels[x, y] != (0, 0, 0, 0): pixels[x, y] = (0, 0, 0, 255)
|
||||
else: pixels[x, y] = (255, 255, 255, 255)
|
||||
rgb_im.save("a"+str(i)+".png")
|
||||
|
|
BIN
build/main.c.o
BIN
build/player.c.o
|
@ -1,7 +1,7 @@
|
|||
#ifndef ASSETS_H
|
||||
#define ASSETS_H
|
||||
|
||||
extern unsigned char** player_sprites;
|
||||
extern unsigned char** player_alpha;
|
||||
extern unsigned char** player_sprites[];
|
||||
extern unsigned char** player_alpha[];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,6 +10,7 @@ void slocate_int(int x, int y, int n) {
|
|||
}
|
||||
|
||||
int main(void) {
|
||||
int ticks;
|
||||
/* Wait that all keys are released before starting the game. */
|
||||
while(kisdown());
|
||||
/* Init game */
|
||||
|
@ -22,6 +23,8 @@ int main(void) {
|
|||
pinit(&game);
|
||||
while(!kcheck(KCEXIT)){
|
||||
sclear();
|
||||
treset();
|
||||
ticks = tgetticks();
|
||||
switch(game.screen){
|
||||
case S_GAME:
|
||||
aframe_done(&game.player.anim);
|
||||
|
@ -46,6 +49,7 @@ int main(void) {
|
|||
game.screen = S_GAME; /* TODO: change this to S_TITLE ... */
|
||||
}
|
||||
supdate();
|
||||
while(!tiselapsed(ticks, 20));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ void pdraw(Game *game) {
|
|||
32, 48,
|
||||
player_alpha[game->player.skin * 2 + game->player.action]
|
||||
[game->player.anim.anim_frame],
|
||||
SNOBLACK
|
||||
SNOWHITE
|
||||
);
|
||||
simage(
|
||||
(*game->map).px, (*game->map).py,
|
||||
|
|