Some more hopefully working progress
This commit is contained in:
@@ -9,19 +9,20 @@
|
||||
#include "../items/item.h"
|
||||
|
||||
extern int playerReach;
|
||||
extern int playerX;
|
||||
extern int playerY;
|
||||
#define playerTileX (playerX / TILE_SIZE)
|
||||
#define playerTileY (playerY / TILE_SIZE)
|
||||
#define playerTileX (player.rect.x / TILE_SIZE)
|
||||
#define playerTileY (player.rect.y / TILE_SIZE)
|
||||
extern int playerSpeed;
|
||||
|
||||
bool isInbounds(int x, int y);
|
||||
extern SDL_Texture *entityTexture;
|
||||
extern SDL_Texture *hudTexture;
|
||||
|
||||
bool isInboundsRect(SDL_Rect rect);
|
||||
//bool isInbounds(int x, int y);
|
||||
//
|
||||
//bool isInboundsRect(SDL_Rect rect);
|
||||
//
|
||||
//bool isInboundsTile(int x, int y);
|
||||
|
||||
bool isInboundsTile(int x, int y);
|
||||
|
||||
void adjustRect(SDL_Rect *rect);
|
||||
void adjustRect(SDL_Rect *rect, SDL_Rect playerRect);
|
||||
|
||||
#define neededHealthIdle 120
|
||||
|
||||
@@ -45,25 +46,26 @@ typedef struct {
|
||||
SDL_Rect targetTileRect;
|
||||
Tile *targetTile;
|
||||
Tile *prevTargetTile;
|
||||
SDL_Rect heldItemRect;
|
||||
int breakingProgress;
|
||||
} PlayerCursor;
|
||||
|
||||
typedef struct {
|
||||
PlayerCursor cursor;
|
||||
PlayerInventory inventory;
|
||||
SDL_Renderer *renderer;
|
||||
uint8_t health;
|
||||
uint8_t prevHealth;
|
||||
uint8_t healthIdle;
|
||||
SDL_Rect rect;
|
||||
} Player;
|
||||
|
||||
void setActivePlayerSlot(Player * plr, uint16_t activeSlotIndex);
|
||||
void setActivePlayerSlot(Player *plr, uint16_t activeSlotIndex);
|
||||
|
||||
void moveActivePlayerSlot(Player *plr, bool up, bool seek);
|
||||
|
||||
void renderPlayer(Player * plr);
|
||||
void renderPlayer(Player *plr);
|
||||
|
||||
void initPlayer(Player * plr);
|
||||
void initPlayer(Player *plr);
|
||||
|
||||
void updatePlayer(Player *plr);
|
||||
|
||||
|
Reference in New Issue
Block a user