taisei/src/player.h

99 lines
1.6 KiB
C
Raw Normal View History

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
*/
#ifndef PLAYER_H
#define PLAYER_H
#include <stdbool.h>
2017-02-07 19:34:55 +01:00
#include "tscomplex.h"
#include "enemy.h"
2012-08-15 16:36:39 +02:00
#include "gamepad.h"
#include "resource/animation.h"
enum {
2012-07-18 18:21:59 +02:00
MOVEFLAG_UP = 1,
MOVEFLAG_DOWN = 2,
MOVEFLAG_LEFT = 4,
MOVEFLAG_RIGHT = 8
};
typedef enum {
2017-02-05 02:25:17 +01:00
Youmu = 0,
Marisa
} Character;
typedef enum {
2017-02-05 02:25:17 +01:00
YoumuOpposite = 0,
YoumuHoming,
MarisaLaser = YoumuOpposite,
2011-07-06 14:33:53 +02:00
MarisaStar = YoumuHoming
} ShotMode;
typedef struct {
complex pos;
short focus;
bool fire;
bool moving;
short dir;
short power;
2017-02-15 18:34:47 +01:00
2012-08-13 19:10:41 +02:00
int graze;
2017-02-15 18:34:47 +01:00
int points;
int lifes;
int bombs;
int recovery;
int deathtime;
int respawntime;
int continues;
Character cha;
ShotMode shot;
Enemy *slaves;
int moveflags;
2012-08-12 18:00:56 +02:00
int curmove;
int movetime;
int prevmove;
int prevmovetime;
int gamepadmove;
2012-08-15 16:36:39 +02:00
int axis_ud;
int axis_lr;
char iddqd;
} Player;
void init_player(Player*);
void prepare_player_for_next_stage(Player*);
void player_draw(Player*);
void player_logic(Player*);
2012-07-20 16:11:24 +02:00
void player_set_char(Player*, Character);
void player_set_power(Player *plr, short npow);
2012-07-20 16:11:24 +02:00
void player_move(Player*, complex delta);
2011-07-05 15:20:19 +02:00
2012-07-20 16:11:24 +02:00
void player_bomb(Player*);
void player_realdeath(Player*);
void player_death(Player*);
2012-08-14 16:14:53 +02:00
void player_graze(Player*, complex, int);
void player_setmoveflag(Player* plr, int key, bool mode);
void player_event(Player* plr, int type, int key);
void player_applymovement(Player* plr);
void player_input_workaround(Player *plr);
#endif