Compare commits

..

No commits in common. "dev" and "master" have entirely different histories.
dev ... master

55 changed files with 68 additions and 328 deletions

12
.gitignore vendored
View File

@ -1,12 +1,12 @@
# Build files
project/build-fx
project/build-cg
projet/build-fx
projet/build-cg
# Executables
project/Odyssee.g1a
project/Odyssee.g3a
projet/Odyssee.g1a
projet/Odyssee.g3a
# Python bytecode
project/__pycache__/*
project/assets-fx/__pycache__/*
projet/__pycache__/*
projet/assets-fx/__pycache__/*

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 865 B

After

Width:  |  Height:  |  Size: 865 B

View File

Before

Width:  |  Height:  |  Size: 934 B

After

Width:  |  Height:  |  Size: 934 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
dessins/fonts/odyssee.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.5" tiledversion="1.7.1" name="Odyssée" tilewidth="8" tileheight="8" spacing="1" tilecount="95" columns="19">
<image source="../dépôts_git/Odyssee_RP/project/assets-fx/tileset.png" width="170" height="44"/>
</tileset>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,31 +0,0 @@
import fxconv
def convert(input_name, output, params, target):
if params["custom-type"] == "map":
convert_map(input_name, output, params, target)
return 0
else:
return 1
def convert_map(input_name, output, params, target):
# Read informations
with open(input_name, "r") as file:
csv_data = file.read().splitlines()
walkable = [-1, 11, 12, 13, 14, 15, 16, 17, 18, 20, 24, 25, 26, 30, 31, 37, 43, 44, 45, 62, 63, 64]
# Convertion into bytes
tiles = bytes()
collision = bytes()
for line in csv_data:
for value in line.split(","):
value = int(value)
tiles += fxconv.u32(value)
collision += fxconv.u8(value in walkable)
data = fxconv.ObjectData()
data += tiles + collision
fxconv.elf(data, output, "_" + params["name"], **target)

View File

@ -1,3 +0,0 @@
*.csv:
custom-type: map
name_regex: (.*)\.csv map_\1

View File

@ -1,32 +0,0 @@
56,56,56,56,56,56,-1,-1,83,-1,34,35,35,36,-1,-1,50,-1,-1,-1,-1,-1,45,-1,-1,-1,-1,56,56,56,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2
56,56,56,56,56,49,49,49,-1,-1,53,54,53,53,-1,-1,50,-1,45,-1,-1,-1,-1,-1,-1,-1,-1,56,56,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19,45,-1,19,-1,-1,-1,45,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,21
56,56,56,56,-1,-1,83,-1,-1,52,53,55,54,53,52,50,-1,-1,-1,-1,45,-1,-1,-1,-1,-1,56,56,56,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,62,19,-1,-1,19,-1,-1,-1,-1,-1,-1,-1,64,45,-1,-1,-1,-1,-1,21
56,56,56,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,56,56,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19,-1,62,38,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,31,-1,-1,-1,21
56,56,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,44,-1,-1,-1,-1,-1,24,56,56,31,-1,-1,-1,-1,-1,-1,-1,-1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1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 25 -1 -1 -1 -1 -1 -1 -1 -1
31 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
32 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

View File

@ -1,103 +0,0 @@
#include <gint/keyboard.h>
#include <gint/timer.h>
#include <gint/clock.h>
#include "core.h"
void next_frame(struct game *game)
{
game->total_tick += ENGINE_TICK;
if (!(game->total_tick % 200)) game->water_frame = (game->water_frame + 1) % 8;
if (!(game->total_tick % 500))
{
switch (game->player->animation_frame)
{
case 2:
game->player->animation_frame = 0;
break;
case 3:
game->player->animation_frame = 1;
break;
default:
game->player->animation_frame = (game->player->animation_frame + 1) % 2;
break;
}
}
}
void analyze_input(struct game *game, const int last_key)
{
switch (last_key)
{
case KEY_UP:
if (is_walkable(game, UP)) game->world_y -= 1;
game->player->direction = UP;
game->player->animation_frame = 2 + (game->player->animation_frame + 1) % 2;
break;
case KEY_RIGHT:
if (is_walkable(game, RIGHT)) game->world_x += 1;
game->player->direction = RIGHT;
game->player->animation_frame = 2 + (game->player->animation_frame + 1) % 2;
break;
case KEY_DOWN:
if (is_walkable(game, DOWN)) game->world_y += 1;
game->player->direction = DOWN;
game->player->animation_frame = 2 + (game->player->animation_frame + 1) % 2;
break;
case KEY_LEFT:
if (is_walkable(game, LEFT)) game->world_x -= 1;
game->player->direction = LEFT;
game->player->animation_frame = 2 + (game->player->animation_frame + 1) % 2;
break;
}
}
uint8_t is_walkable(const struct game *game, const int direction)
{
switch (direction)
{
case UP:
if (game->world_y + 4 >= 0) return game->map->collision[game->world_y + 4][game->world_x + 7];
break;
case RIGHT:
if (game->world_x + 8 < MAP_WIDTH) return game->map->collision[game->world_y + 5][game->world_x + 8];
break;
case DOWN:
if (game->world_y + 6 < MAP_HEIGHT) return game->map->collision[game->world_y + 6][game->world_x + 7];
break;
case LEFT:
if (game->world_x + 5 >= 0) return game->map->collision[game->world_y + 5][game->world_x + 6];
break;
}
return 0;
}
int rtc_key(void)
{
int opt = GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA & ~GETKEY_REP_ARROWS;
int timeout = 1;
key_event_t ev = getkey_opt(opt, &timeout);
if (ev.type == KEYEV_NONE) return 0;
return ev.key;
}
int callback_tick(volatile int *tick)
{
*tick = 1;
return TIMER_CONTINUE;
}

View File

@ -1,63 +0,0 @@
#ifndef _CORE_H
#define _CORE_H
#define ENGINE_TICK 100
#define TILESET_WIDTH 19
#define TILE_SIZE 8
#define SCREEN_WIDTH 16
#define SCREEN_HEIGHT 8
#define MAP_WIDTH 64
#define MAP_HEIGHT 32
#define UP 0
#define RIGHT 1
#define DOWN 2
#define LEFT 3
struct player
{
int direction;
int animation_frame;
};
struct map
{
int data[MAP_HEIGHT][MAP_WIDTH];
uint8_t collision[MAP_HEIGHT][MAP_WIDTH];
};
struct game
{
// Current map and coord's map in the world
const struct map *map;
int world_x, world_y;
struct player *player;
int total_tick;
int water_frame;
};
// next_frame : compute the next frame to display
void next_frame(struct game *game);
// analyze_input : change the player's position
void analyze_input(struct game *game, const int last_key);
// is_walkable : check if the player can go on the targeted case
uint8_t is_walkable(const struct game *game, const int direction);
// rtc_key : returns the key code with RTC system
int rtc_key(void);
// callback_tick : timer's function
int callback_tick(volatile int *tick);
#endif /* _CORE_H */

View File

@ -1,35 +0,0 @@
#include <gint/display.h>
#include <gint/gray.h>
#include <math.h>
#include "display_engine.h"
void draw_map(const struct game *game)
{
extern const bopti_image_t img_tileset;
extern const bopti_image_t img_water;
for (int i = 0; i < SCREEN_HEIGHT; i ++)
{
for (int j = 0; j < SCREEN_WIDTH; j++)
{
if ((game->world_y + i < MAP_HEIGHT && game->world_y + i >= 0 && game->world_x + j < MAP_WIDTH && game->world_x + j >= 0) && (game->map->data[game->world_y + i][game->world_x + j] != -1))
{
unsigned int tile_x = (TILE_SIZE + 1) * (game->map->data[game->world_y + i][game->world_x + j] % TILESET_WIDTH);
unsigned int tile_y = (TILE_SIZE + 1) * (game->map->data[game->world_y + i][game->world_x + j] / TILESET_WIDTH);
if (game->map->data[game->world_y + i][game->world_x + j] != 56) dsubimage(j * TILE_SIZE, i * TILE_SIZE, &img_tileset, tile_x, tile_y, 8, 8, DIMAGE_NONE);
else dsubimage(j * TILE_SIZE, i * TILE_SIZE, &img_water, 9 * game->water_frame, 0, 8, 8, DIMAGE_NONE);
}
}
}
}
void draw_player(const struct game *game)
{
extern const bopti_image_t img_player;
dsubimage(56, 35, &img_player, 9 * game->player->animation_frame, 13 * game->player->direction, 8, 12, DIMAGE_NONE);
}

View File

@ -1,14 +0,0 @@
#ifndef _DISPLAY_ENGINE_H
#define _DISPLAY_ENGINE_H
#include "core.h"
// draw_map : display a map on the screen
void draw_map(const struct game *game);
//draw_player : display the player with animation
void draw_player(const struct game *game);
#endif /* _DISPLAY_ENGINE_H */

View File

@ -12,7 +12,6 @@ find_package(Gint 2.1 REQUIRED)
set(SOURCES
src/main.c
src/core.c
src/display_engine.c
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
@ -23,10 +22,8 @@ set(ASSETS_fx
assets-fx/odyssee.png
assets-fx/title.png
assets-fx/bgrounds.png
assets-fx/tileset.png
assets-fx/player.png
assets-fx/water.png
assets-fx/map/world.csv
assets-fx/player_sword.png
# ...
)
set(ASSETS_cg
@ -34,7 +31,6 @@ set(ASSETS_cg
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
fxconv_declare_converters(assets-fx/converters.py)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
projet/assets-fx/player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

24
projet/src/core.c Normal file
View File

@ -0,0 +1,24 @@
#include <gint/keyboard.h>
#include <gint/timer.h>
#include <gint/clock.h>
#include "core.h"
int rtc_key(void)
{
int opt = GETKEY_DEFAULT & ~GETKEY_MOD_SHIFT & ~GETKEY_MOD_ALPHA & ~GETKEY_REP_ARROWS;
int timeout = 1;
key_event_t ev = getkey_opt(opt, &timeout);
if(ev.type == KEYEV_NONE) return 0;
return ev.key;
}
int callback_tick(volatile int *tick)
{
*tick = 1;
return TIMER_CONTINUE;
}

14
projet/src/core.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef _CORE_H
#define _CORE_H
#define ENGINE_TICK 100
#define PARTICULE_NB 50
// rtc_key : returns the key code with RTC system
int rtc_key(void);
// callback_tick : timer's function
int callback_tick(volatile int *tick);
#endif /* _CORE_H */

View File

@ -9,33 +9,22 @@
*/
#include <gint/display.h>
#include <gint/gray.h>
#include <gint/keyboard.h>
#include <gint/timer.h>
#include <gint/clock.h>
#include <gint/std/stdlib.h>
#include "core.h"
#include "display_engine.h"
// title_screen : display the title screen with particule effect
void title_screen(void);
void main_loop(void);
int main(void)
{
extern font_t font_odyssee;
dfont(&font_odyssee);
dgray(DGRAY_ON);
title_screen();
main_loop();
dgray(DGRAY_OFF);
dupdate();
return 1;
}
@ -43,42 +32,44 @@ int main(void)
void title_screen(void)
{
extern const bopti_image_t img_title;
dclear(C_WHITE);
dimage(0, 0, &img_title);
dupdate();
getkey();
}
void main_loop(void)
{
extern const struct map map_world;
int key = 0;
struct player player = {DOWN, 0};
struct game game = {&map_world, 0, 0, &player, 0, 0};
// Initialise the particule effect
srand(1551001551);
int coord_x[PARTICULE_NB];
int coord_y[PARTICULE_NB];
for (int i = 0; i < PARTICULE_NB; i ++)
{
coord_x[i] = rand() % 128;
coord_y[i] = rand() % 64;
}
static volatile int tick = 0;
int t = timer_configure(TIMER_ANY, ENGINE_TICK*1000, GINT_CALL(callback_tick, &tick));
if (t >= 0) timer_start(t);
while (key != KEY_EXIT)
{
{
while (!tick) sleep();
tick = 0;
dclear(C_WHITE);
dimage(0, 0, &img_title);
// Update particules positions
for (int i = 0; i < PARTICULE_NB; i ++)
{
dpixel(coord_x[i], coord_y[i], C_BLACK);
coord_x[i] += (rand() % 3) - 1;
coord_y[i] += (rand() % 3) - 1;
if (coord_x[i] < 0 || coord_x[i] > 128) coord_x[i] = rand() % 128;
if (coord_y[i] < 0 || coord_y[i] > 64) coord_y[i] = rand() % 64;
}
next_frame(&game);
draw_map(&game);
draw_player(&game);
dupdate();
key = rtc_key();
analyze_input(&game, key);
}
if (t >= 0) timer_stop(t);
}