Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #83 from Maksasj/room-rework
Browse files Browse the repository at this point in the history
Room rework
  • Loading branch information
Maksasj authored Jan 28, 2023
2 parents b6f530e + 43ca0d0 commit 00c6414
Show file tree
Hide file tree
Showing 56 changed files with 2,153 additions and 1,312 deletions.
6 changes: 3 additions & 3 deletions include/collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

/* Enum that contains all definet collision types */
typedef enum CollisionType {
NONE,

WALL,
TRAP,

OPENED_DOOR,
CLOSED_DOOR,

NEXT_FLOOR_ENTRANCE,

NONE
NEXT_FLOOR_ENTRANCE
} CollisionType;

#endif
1 change: 1 addition & 0 deletions include/utils/grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define _GRID_H_

#include "types.h"
#include "../collision.h"
#include "queue.h"
#include <stdlib.h>

Expand Down
8 changes: 8 additions & 0 deletions include/utils/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,12 @@ void setScreenBlock(vu16* _block, u16 _value);
*/
void memcpy16DMA(u16* _dest, u16* _source, i32 _amount);

#define TILE_BACKGROUND_SCREEN_BLOCK screenBlock(25)

#define LIGHT_BACKGROUND_SCREEN_BLOCK screenBlock(27)

#define DYNAMIC_UI_BACKGROUND_SCREEN_BLOCK screenBlock(29)

#define GAME_UI_BACKGROUND_SCREEN_BLOCK screenBlock(31)

#endif
2 changes: 2 additions & 0 deletions include/utils/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ u32 random();
*/
void setSeed(u32 _seed);

inline u32 getRandomInRange(u32 min, u32 max);

#endif
5 changes: 5 additions & 0 deletions include/utils/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

#define _ABS_(x) ((x) < 1 ? -(x) : (x))

#define _CLAMP_(value, min, max) (min < max \
? (value < min ? min : value > max ? max : value) \
: (value < max ? max : value > min ? min : value) \
)

// typedefs to reduce the names of existing types
typedef unsigned char u8;
typedef unsigned short u16;
Expand Down
13 changes: 13 additions & 0 deletions include/world/prototypes/ancient_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _ANCIENT_ROOM_H_
#define _ANCIENT_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void ancientRoomInit(Room* _self);

void ancientRoomRender(Room* _self, void* _world);

void ancientRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/corridors_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _CORRIDORS_ROOM_H_
#define _CORRIDORS_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void corridorsRoomInit(Room* _self);

void corridorsRoomRender(Room* _self, void* _world);

void corridorsRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
15 changes: 15 additions & 0 deletions include/world/prototypes/dark_labyrinth_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _DARK_LABYRINTH_ROOM_H_
#define _DARK_LABYRINTH_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../../item/item_macros.h"

#include "../tile.h"

void darkLabyrinthRoomInit(Room* _self, Entity* _player);

void darkLabyrinthRoomRender(Room* _self, void* _world);

void darkLabyrinthRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
15 changes: 15 additions & 0 deletions include/world/prototypes/dumbbell_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _DUMBBELL_ROOM_H_
#define _DUMBBELL_ROOM_H_

#include "../../item/item_macros.h"
#include "../../entity/entity_macros.h"
#include "../../entity/prototypes/player.h"
#include "../tile.h"

void dumbbellRoomInit(Room* _self, Entity* _player);;

void dumbbellRoomRender(Room* _self, void* _world);

void dumbbellRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/end_game_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _END_GAME_ROOM_H_
#define _END_GAME_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void endGameRoomInit(Room* _self);

void endGameRoomRender(Room* _self, void* _world);

void endGameRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/floor_beginning_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _FLOOR_BEGINNING_ROOM_H_
#define _FLOOR_BEGINNING_ROOM_H_

#include "../room.h"
#include "../tile.h"

void floorBeginningRoomInit(Room* _self, Entity* _player);

void floorBeginningRoomRender(Room* _self, void* _world);

void floorBeginningRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/floor_end_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _FLOOR_END_ROOM_H_
#define _FLOOR_END_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void floorEndRoomInit(Room* _self);

void floorEndRoomRender(Room* _self, void* _world);

void floorEndRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/four_ancient_skeleton_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _FOUR_ANCIENT_SKELETON_ROOM_H_
#define _FOUR_ANCIENT_SKELETON_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void fourAncientSkeletonRoomInit(Room* _self, Entity* _player);

void fourAncientSkeletonRoomRender(Room* _self, void* _world);

void fourAncientSkeletonRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
15 changes: 15 additions & 0 deletions include/world/prototypes/king_in_corridor_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _KING_IN_CORRIDOR_ROOM_H_
#define _KING_IN_CORRIDOR_ROOM_H_

#include "../../item/item_macros.h"
#include "../../entity/entity_macros.h"
#include "../../entity/prototypes/player.h"
#include "../tile.h"

void kingInCorridorRoomInit(Room* _self, Entity* _player);

void kingInCorridorRoomRender(Room* _self, void* _world);

void kingInCorridorRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
15 changes: 15 additions & 0 deletions include/world/prototypes/labyrinth_1_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _LABYRINTH_1_ROOM_H_
#define _LABYRINTH_1_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../../item/item_macros.h"

#include "../tile.h"

void labyrinth1RoomInit(Room* _self, Entity* _player);

void labyrinth1RoomRender(Room* _self, void* _world);

void labyrinth1RoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
15 changes: 15 additions & 0 deletions include/world/prototypes/labyrinth_2_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _LABYRINTH_2_ROOM_H_
#define _LABYRINTH_2_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../../item/item_macros.h"

#include "../tile.h"

void labyrinth2RoomInit(Room* _self, Entity* _player);

void labyrinth2RoomRender(Room* _self, void* _world);

void labyrinth2RoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
15 changes: 15 additions & 0 deletions include/world/prototypes/labyrinth_3_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _LABYRINTH_3_ROOM_H_
#define _LABYRINTH_3_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../../item/item_macros.h"

#include "../tile.h"

void labyrinth3RoomInit(Room* _self, Entity* _player);

void labyrinth3RoomRender(Room* _self, void* _world);

void labyrinth3RoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/necromancer_boss_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _NECROMANCER_BOSS_ROOM_H_
#define _NECROMANCER_BOSS_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void necromancerBossRoomInit(Room* _self);

void necromancerBossRoomRender(Room* _self, void* _world);

void necromancerBossRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/pac_man_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _PAC_MAN_ROOM_H_
#define _PAC_MAN_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void pacmanRoomInit(Room* _self);

void pacmanRoomRender(Room* _self, void* _world);

void pacmanRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/pyramid_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _PYRAMID_ROOM_H_
#define _PYRAMID_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void pyramidRoomInit(Room* _self);

void pyramidRoomRender(Room* _self, void* _world);

void pyramidRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/spike_madness_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _SPIKE_MADNESS_ROOM_H_
#define _SPIKE_MADNESS_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void spikeMadnessRoomInit(Room* _self);

void spikeMadnessRoomRender(Room* _self, void* _world);

void spikeMadnessRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/symmetric_1_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _SYMMETRIC_1_ROOM_H_
#define _SYMMETRIC_1_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void symmetric1RoomInit(Room* _self);

void symmetric1RoomRender(Room* _self, void* _world);

void symmetric1RoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/symmetric_2_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _SYMMETRIC_2_ROOM_H_
#define _SYMMETRIC_2_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void symmetric2RoomInit(Room* _self);

void symmetric2RoomRender(Room* _self, void* _world);

void symmetric2RoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
13 changes: 13 additions & 0 deletions include/world/prototypes/two_ninja_skeleton_room.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _TWO_NINJA_SKELETON_ROOM_H_
#define _TWO_NINJA_SKELETON_ROOM_H_

#include "../../entity/entity_macros.h"
#include "../tile.h"

void twoNinjaSkeletonRoomInit(Room* _self);

void twoNinjaSkeletonRoomRender(Room* _self, void* _world);

void twoNinjaSkeletonRoomUpdateCallback(void* _world, Room* _self, Entity* _player);

#endif
Loading

0 comments on commit 00c6414

Please sign in to comment.