mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-05-30 00:47:34 -04:00
Trophy, Object impl, and cleanup
This commit is contained in:
@@ -2,11 +2,9 @@
|
||||
|
||||
#include "Actor.h"
|
||||
|
||||
//GameActor()
|
||||
|
||||
AActor::AActor() {}
|
||||
|
||||
// Virtual functions to be overridden by derived classes
|
||||
// Virtual functions to be overridden by derived classes
|
||||
void AActor::Tick() { }
|
||||
void AActor::Draw(Camera *camera) { }
|
||||
void AActor::Collision(Player* player, AActor* actor) {}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "engine/actors/ATree.h"
|
||||
#include "engine/actors/ACloud.h"
|
||||
#include "engine/vehicles/Train.h"
|
||||
#include "engine/objects/Trophy.h"
|
||||
|
||||
extern "C" {
|
||||
#include "main.h"
|
||||
@@ -190,10 +191,12 @@ void TestCourse::SpawnActors() {
|
||||
Vec3f pos = {0, 80, 0};
|
||||
//gWorldInstance.AddActor(new ACloud(pos));
|
||||
|
||||
gWorldInstance.AddActor(new OSeagull(0, pos));
|
||||
gWorldInstance.AddActor(new OSeagull(1, pos));
|
||||
gWorldInstance.AddActor(new OSeagull(2, pos));
|
||||
gWorldInstance.AddActor(new OSeagull(3, pos));
|
||||
// gWorldInstance.AddActor(new OSeagull(0, pos));
|
||||
// gWorldInstance.AddActor(new OSeagull(1, pos));
|
||||
// gWorldInstance.AddActor(new OSeagull(2, pos));
|
||||
// gWorldInstance.AddActor(new OSeagull(3, pos));
|
||||
|
||||
gWorldInstance.AddObject(new OTrophy(FVector(0,0,0), OTrophy::TrophyType::GOLD, OTrophy::Behaviour::GO_FISH));
|
||||
}
|
||||
|
||||
// Likely sets minimap boundaries
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#include <libultraship.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
#include "World.h"
|
||||
|
||||
extern "C" {
|
||||
#include "camera.h"
|
||||
}
|
||||
|
||||
|
||||
//GameActor()
|
||||
|
||||
GameObject::GameObject() {}
|
||||
|
||||
// Virtual functions to be overridden by derived classes
|
||||
void GameObject::Tick() { }
|
||||
void GameObject::Draw(Camera* camera) { }
|
||||
void GameObject::Collision() {}
|
||||
void GameObject::Expire() { }
|
||||
void GameObject::Destroy() { }
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <libultraship.h>
|
||||
#include "Object.h"
|
||||
|
||||
#include "World.h"
|
||||
|
||||
extern "C" {
|
||||
#include "camera.h"
|
||||
}
|
||||
|
||||
|
||||
//GameActor()
|
||||
|
||||
OObject::OObject() {}
|
||||
|
||||
// Virtual functions to be overridden by derived classes
|
||||
void OObject::Tick() { }
|
||||
void OObject::Draw(s32 cameraId) { }
|
||||
void OObject::Collision() {}
|
||||
void OObject::Expire() { }
|
||||
void OObject::Destroy() { }
|
||||
@@ -7,17 +7,17 @@ extern "C" {
|
||||
#include "objects.h"
|
||||
}
|
||||
|
||||
class GameObject {
|
||||
class OObject {
|
||||
public:
|
||||
uint8_t uuid[16];
|
||||
Object o;
|
||||
|
||||
virtual ~GameObject() = default;
|
||||
virtual ~OObject() = default;
|
||||
|
||||
explicit GameObject();
|
||||
explicit OObject();
|
||||
|
||||
virtual void Tick();
|
||||
virtual void Draw(Camera* camera);
|
||||
virtual void Draw(s32 cameraId);
|
||||
virtual void Collision();
|
||||
virtual void Expire();
|
||||
virtual void Destroy();
|
||||
@@ -18,7 +18,7 @@ extern "C" {
|
||||
//! @todo make adjustable properties for squishSize and boundingBoxSize
|
||||
|
||||
/**
|
||||
* Thwomp GameObject
|
||||
* Thwomp OObject
|
||||
*
|
||||
* The game automatically places the actor on the ground so you do not need to provide a Y coordinate value.
|
||||
*
|
||||
|
||||
@@ -15,6 +15,17 @@ extern "C" {
|
||||
#include "some_data.h"
|
||||
}
|
||||
|
||||
//! @todo move this like World.h or something
|
||||
struct FVector {
|
||||
float x, y, z;
|
||||
|
||||
FVector& operator=(const FVector& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
class OTrophy : public OObject {
|
||||
public:
|
||||
|
||||
+2
-2
@@ -384,9 +384,9 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
void CourseManager_DrawObjects(Camera* camera) {
|
||||
void CourseManager_DrawObjects(s32 cameraId) {
|
||||
if (gWorldInstance.CurrentCourse) {
|
||||
gWorldInstance.DrawObjects(camera);
|
||||
gWorldInstance.DrawObjects(cameraId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ void CourseManager_InitClouds();
|
||||
void CourseManager_DrawActor(Camera* camera, struct Actor* actor);
|
||||
|
||||
void CourseManager_TickObjects();
|
||||
void CourseManager_DrawObjects(Camera* camera);
|
||||
void CourseManager_DrawObjects(s32 cameraId);
|
||||
|
||||
void CourseManager_UpdateClouds(s32 arg0, Camera* camera);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user