mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2024-12-29 13:03:43 +01:00
Very simple player selection
This commit is contained in:
parent
587e8e872d
commit
3f38bf4ac2
7 changed files with 17 additions and 8 deletions
|
@ -68,6 +68,7 @@ set(ASSETS_cg_EGA64
|
||||||
|
|
||||||
set(ASSETS_fx
|
set(ASSETS_fx
|
||||||
assets-fx/player_male.png
|
assets-fx/player_male.png
|
||||||
|
assets-fx/player_female.png
|
||||||
assets-fx/npc/char/npc_male.png
|
assets-fx/npc/char/npc_male.png
|
||||||
assets-fx/npc/char/npc_female.png
|
assets-fx/npc/char/npc_female.png
|
||||||
assets-fx/npc/char/npc_milkman.png
|
assets-fx/npc/char/npc_milkman.png
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
profile: p8
|
profile: p8
|
||||||
scale: 1
|
scale: 1
|
||||||
|
|
||||||
player_male.png:
|
|
||||||
name: demo_player_img
|
|
||||||
|
|
||||||
font.png:
|
font.png:
|
||||||
name: fontRPG
|
name: fontRPG
|
||||||
custom-type: font
|
custom-type: font
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
player_male.png:
|
player_male.png:
|
||||||
type: bopti-image
|
type: bopti-image
|
||||||
name: demo_player_img
|
name: player_male_img
|
||||||
player_female.png:
|
player_female.png:
|
||||||
type: bopti-image
|
type: bopti-image
|
||||||
name: player_female
|
name: player_female_img
|
||||||
|
|
||||||
player_face.png:
|
player_face.png:
|
||||||
type: bopti-image
|
type: bopti-image
|
||||||
|
|
|
@ -114,6 +114,14 @@ void game_get_inputs(Game *game) {
|
||||||
if(keydown(KEY_UP)) player_move(game, D_UP);
|
if(keydown(KEY_UP)) player_move(game, D_UP);
|
||||||
if(keydown(KEY_DOWN)) player_move(game, D_DOWN);
|
if(keydown(KEY_DOWN)) player_move(game, D_DOWN);
|
||||||
if(keydown(KEY_SHIFT)) player_action(game);
|
if(keydown(KEY_SHIFT)) player_action(game);
|
||||||
|
if(keydown(KEY_OPTN)){
|
||||||
|
game->player.is_male = !game->player.is_male;
|
||||||
|
/* TODO: Make something cleaner */
|
||||||
|
while(keydown(KEY_OPTN)){
|
||||||
|
clearevents();
|
||||||
|
sleep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Display Debug Information on screen */
|
/* Display Debug Information on screen */
|
||||||
#if DEBUGMODE
|
#if DEBUGMODE
|
||||||
|
|
|
@ -43,6 +43,7 @@ typedef struct {
|
||||||
bool isDoingAction;
|
bool isDoingAction;
|
||||||
/* the player is interacting with a NPC */
|
/* the player is interacting with a NPC */
|
||||||
bool isInteractingWithNPC;
|
bool isInteractingWithNPC;
|
||||||
|
bool is_male;
|
||||||
} Player;
|
} Player;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ extern Map *worldRPG[];
|
||||||
/* Game data (defined in "game.h")*/
|
/* Game data (defined in "game.h")*/
|
||||||
Game game = {
|
Game game = {
|
||||||
NULL,
|
NULL,
|
||||||
{12*PXSIZE, 36*PXSIZE, 0, 0, 12*PXSIZE, 36*PXSIZE, 100, SPEED, false, 0, false, false},
|
{12*PXSIZE, 36*PXSIZE, 0, 0, 12*PXSIZE, 36*PXSIZE, 100, SPEED, false, 0, false, false, true},
|
||||||
{{}, {}, 0},
|
{{}, {}, 0},
|
||||||
false, false, false, 0
|
false, false, false, 0
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
#include "npc.h"
|
#include "npc.h"
|
||||||
#include <gint/display.h>
|
#include <gint/display.h>
|
||||||
|
|
||||||
extern bopti_image_t demo_player_img;
|
extern bopti_image_t player_male_img;
|
||||||
|
extern bopti_image_t player_female_img;
|
||||||
extern bopti_image_t npc_male;
|
extern bopti_image_t npc_male;
|
||||||
extern bopti_image_t npc_female;
|
extern bopti_image_t npc_female;
|
||||||
extern bopti_image_t npc_milkman;
|
extern bopti_image_t npc_milkman;
|
||||||
|
@ -50,7 +51,8 @@ extern uint32_t nbNPC;
|
||||||
|
|
||||||
void player_draw(Game *game) {
|
void player_draw(Game *game) {
|
||||||
Player *player = &game->player;
|
Player *player = &game->player;
|
||||||
dimage(player->px-P_WIDTH/2, player->py-P_HEIGHT/2, &demo_player_img);
|
dimage(player->px-P_WIDTH/2, player->py-P_HEIGHT/2,
|
||||||
|
player->is_male ? &player_male_img : &player_female_img);
|
||||||
}
|
}
|
||||||
|
|
||||||
void player_move(Game *game, Direction direction) {
|
void player_move(Game *game, Direction direction) {
|
||||||
|
|
Loading…
Reference in a new issue