aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-12-22 13:51:23 -0700
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-12-22 13:51:23 -0700
commit5c9ab091b5556180c645c0981093a95b2eb61c25 (patch)
tree288e657798c1108cea9bb82a495c276d4f24ea9e
parent0be4fca7d5d05fe3cb161ed92218277f4af739e0 (diff)
Working on the ship viewer thingy thing
-rw-r--r--src/screens/infoScreen.c70
-rw-r--r--src/screens/infoScreen.h9
2 files changed, 78 insertions, 1 deletions
diff --git a/src/screens/infoScreen.c b/src/screens/infoScreen.c
index 86c0bb3..98af36f 100644
--- a/src/screens/infoScreen.c
+++ b/src/screens/infoScreen.c
@@ -1,18 +1,86 @@
#include "infoScreen.h"
#include "game.h"
+// Fuck this capitalist society. Long live Karl Marx!
+
+const EntityUserInfo infoScreenEntityInfo[INFO_SCREEN_ENTITY_COUNT] = {
+ (EntityUserInfo){
+ .type = ENTITY_ANTIFA,
+ .assetId = ANTIFA_SHIP_ASSET,
+ .cameraPosition = (Vector3){10.0, 10.0, 10.0},
+ .msg = "The player ship. Its a anti fascist ship and is completely bad ass."
+ },
+ (EntityUserInfo){
+ .type = ENTITY_SOLDATO,
+ .assetId = SOLDATO_ASSET,
+ .cameraPosition = (Vector3){10.0, 10.0, 10.0},
+ .msg = "A wippy little ship. It follows the other ships like ants."
+ },
+ (EntityUserInfo){
+ .type = ENTITY_CAPORALE,
+ .assetId = CAPORATE_ASSET,
+ .cameraPosition = (Vector3){10.0, 10.0, 10.0},
+ .msg = "A pretty normal space ship. Often acts as a leader for the soldato."
+ },
+ (EntityUserInfo){
+ .type = ENTITY_SERGENTE,
+ .assetId = SERGENTE_ASSET,
+ .cameraPosition = (Vector3){10.0, 10.0, 10.0},
+ .msg = "A funny little dude that packs a lot of power"
+ },
+ (EntityUserInfo){
+ .type = ENTITY_MARESCIALLO,
+ .assetId = MARESCIALLO_ASSET,
+ .cameraPosition = (Vector3){10.0, 10.0, 10.0},
+ .msg = "A sneaky little ship based on a stealth jet."
+ },
+ (EntityUserInfo)
+ {
+ .type = ENTITY_GENERALE,
+ .assetId = GENERALE_ASSET,
+ .cameraPosition = (Vector3){10.0, 10.0, 10.0},
+ .msg = "A ufo that goes zig zag and shoots its epic deadly laser.",
+ },
+ (EntityUserInfo){
+ .type = ENTITY_MUSSOLINI,
+ .assetId = MUSSOLINI_ASSET,
+ .cameraPosition = (Vector3){100.0, 100.0, 100.0},
+ .msg = "A deadly mother fucker named after the Italian fascist dictator"
+ }
+};
+
void initInfoScreen(Game * game) {
InfoScreen * infoScreen = &game->infoScreen;
infoScreen->goBackButton = (Rectangle){0.0, 25.0, 100.0, 50.0};
+
+ infoScreen->camera = (Camera3D){
+ .position = infoScreenEntityInfo[0].cameraPosition,
+ .target = Vector3Zero(),
+ .up = (Vector3){0.0, 1.0, 0.0},
+ .fovy = 90.0,
+ .projection = CAMERA_PERSPECTIVE
+ };
+
+ infoScreen->currentEntity = 0;
}
void updateInfoScreen(Game * game) {
InfoScreen * infoScreen = &game->infoScreen;
- ClearBackground(RAYWHITE);
+ ClearBackground(BLACK);
if (GuiButton(infoScreen->goBackButton, "Back"))
game->screenId = SCREEN_MAIN_MENU;
+
+ EntityUserInfo info = infoScreenEntityInfo[infoScreen->currentEntity];
+
+ BeginMode3D(infoScreen->camera);
+
+ DrawModelWires(game->assets.models[info.assetId], Vector3Zero(), 1.0, GREEN);
+
+ DrawGrid(32, 5.0);
+
+ EndMode3D();
}
void resizeInfoScreen(Game * game, InfoScreen * infoScreen) {
diff --git a/src/screens/infoScreen.h b/src/screens/infoScreen.h
index a677a3d..128033a 100644
--- a/src/screens/infoScreen.h
+++ b/src/screens/infoScreen.h
@@ -5,13 +5,22 @@
#ifndef INFO_SCREEN_H
#define INFO_SCREEN_H
+#define ENTITY_USER_INFO_MSG_MAX 100
+#define INFO_SCREEN_ENTITY_COUNT 7
+
typedef struct EntityUserInfo {
EntityType type;
AssetId assetId;
+ Vector3 cameraPosition;
+ char msg[ENTITY_USER_INFO_MSG_MAX];
} EntityUserInfo;
+extern const EntityUserInfo infoScreenEntityInfo[INFO_SCREEN_ENTITY_COUNT];
+
typedef struct InfoScreen {
Rectangle goBackButton;
+ Camera3D camera;
+ int currentEntity;
} InfoScreen;
void initInfoScreen(Game * game);