Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
calint committed Jul 15, 2024
1 parent 939dc71 commit 1c7445f
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/application/objects/asteroid_large.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

// include order relevant
#include "../configuration.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/application/objects/asteroid_medium.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

// include order relevant
#include "../configuration.hpp"
Expand Down
5 changes: 3 additions & 2 deletions src/application/objects/asteroid_small.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

// include order relevant
#include "../configuration.hpp"
Expand All @@ -10,9 +11,9 @@
//
#include "../utils.hpp"

static uint64_t power_up_soonest_next_spawn_ms = 0;

class asteroid_small final : public object {
static inline uint64_t power_up_soonest_next_spawn_ms = 0;

public:
inline asteroid_small() {
if (debug_multiplayer) {
Expand Down
1 change: 1 addition & 0 deletions src/application/objects/cube.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

class cube final : public object {
public:
Expand Down
1 change: 1 addition & 0 deletions src/application/objects/fragment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

class fragment final : public object {
public:
Expand Down
10 changes: 5 additions & 5 deletions src/application/objects/power_up.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

#include "../utils.hpp"

class power_up final : public object {
uint64_t death_time_ms = 0;
uint64_t scale_time_ms = 0;
bool scale_up = false;

public:
inline power_up() {
if (debug_multiplayer) {
Expand Down Expand Up @@ -66,9 +71,4 @@ class power_up final : public object {

return false;
}

private:
uint64_t death_time_ms = 0;
uint64_t scale_time_ms = 0;
bool scale_up = false;
};
8 changes: 5 additions & 3 deletions src/application/objects/ship.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

#include "ship_bullet.hpp"

Expand All @@ -21,6 +22,8 @@ static uint32_t constexpr bullet_levels_length =
static uint32_t bullet_levels_index = 0;

class ship final : public object {
uint64_t ready_to_fire_at_ms = 0;

public:
inline ship() {
if (debug_multiplayer) {
Expand All @@ -30,7 +33,7 @@ class ship final : public object {
name.c_str());
}
glob_ix(glob_ix_ship);
scale = {1, 1, 1};
scale = {1.0f, 1.0f, 1.0f};
bounding_radius = glob().bounding_radius * scale.x;
mass = 150;
collision_bits = cb_hero;
Expand Down Expand Up @@ -87,6 +90,7 @@ class ship final : public object {
camera.look_at = {0, 0, -.000001f};
// note: -.000001f because of the math of 'look at'
}

return true;
}

Expand Down Expand Up @@ -142,6 +146,4 @@ class ship final : public object {
}
ready_to_fire_at_ms = frame_context.ms + bl.fire_interval_ms;
}

uint64_t ready_to_fire_at_ms = 0;
};
3 changes: 2 additions & 1 deletion src/application/objects/ship_bullet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

#include "fragment.hpp"

Expand All @@ -15,7 +16,7 @@ class ship_bullet final : public object {
name.c_str());
}
glob_ix(glob_ix_bullet);
scale = {1, 1, 1};
scale = {1.0f, 1.0f, 1.0f};
bounding_radius = glob().bounding_radius * scale.x;
mass = 5;
collision_bits = cb_hero_bullet;
Expand Down
1 change: 1 addition & 0 deletions src/application/objects/sphere.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

class sphere final : public object {
public:
Expand Down
1 change: 1 addition & 0 deletions src/application/objects/tetra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08
// reviewed: 2024-07-15

class tetra final : public object {
public:
Expand Down
3 changes: 2 additions & 1 deletion src/application/objects/ufo.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
// reviewed: 2024-07-15

#include "ufo_bullet.hpp"

Expand Down Expand Up @@ -45,8 +46,8 @@ class ufo final : public object {
next_fire_ms = frame_context.ms + ufo_fire_rate_interval_ms;
if (hero) {
ufo_bullet *ub = new (objects.alloc()) ufo_bullet{};
vec3 dir = normalize(hero->position - position);
ub->position = position;
vec3 const dir = normalize(hero->position - position);
ub->velocity = ufo_bullet_velocity * dir;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/application/objects/ufo_bullet.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
// reviewed: 2024-07-15

#include "fragment.hpp"

Expand Down
5 changes: 1 addition & 4 deletions src/application/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// reviewed: 2024-01-04
// reviewed: 2024-01-08
// reviewed: 2024-07-08

// include order matters
#include "configuration.hpp"
//
// reviewed: 2024-07-15

inline static auto rnd1(float const range) -> float {
int const r = rand();
Expand Down

0 comments on commit 1c7445f

Please sign in to comment.