Minor edits

master
Mark 2024-01-08 23:10:30 -08:00
parent 1b9e1f2877
commit 966ad4e5a4
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
3 changed files with 38 additions and 31 deletions

10
TODO.md
View File

@ -17,6 +17,10 @@
- Particles when a ship is damaged (events)
- Sticky radar
- Clean up world and objects
- Fix gun points
- Arbitrary size resource names
- How does a player control a ship (also fix behaviors)
----------------------------------
@ -69,6 +73,7 @@
- where to go
- etc, extra flags
- Advanced particle physics (must move to cpu. Maybe both?)
- Background simulation (two modes: physics-what's visible, data-everything else)
## Faction interaction
@ -109,6 +114,10 @@
- Missions
- Procedural suns
- Heat and energy
- Non-removable outfits
- Space-converting outfits
- Damage struct and debuffs
-
## Camera
- Shake/wobble on heavy hits?
@ -145,6 +154,7 @@
- How packer and optimizations work, and why
- How big should sprite resolutions be? How about frame rate?
- Naming: atlas, sprite, image, frame, texture
- Outfits may not change unless you've landed. They might not change ever for CC ships!
## Ideas

View File

@ -1,4 +1,6 @@
use cgmath::Point2;
use content::Ship;
use object::{ship::ShipPersonality, GameData};
use std::time::Instant;
use winit::event::{ElementState, MouseButton, MouseScrollDelta, TouchPhase, VirtualKeyCode};
@ -26,6 +28,8 @@ pub struct Game {
shipbehaviors: Vec<Box<dyn ShipBehavior>>,
playerbehavior: behavior::Player,
gamedata: GameData,
content: content::Content,
world: World,
new_particles: Vec<ParticleBuilder>,
@ -34,6 +38,8 @@ pub struct Game {
impl Game {
pub fn new(ct: content::Content) -> Self {
let mut physics = World::new();
let mut gamedata = GameData::new();
let ss = ct.get_ship(content::ShipHandle { index: 0 });
let mut o1 = object::OutfitSet::new(ss);
@ -43,49 +49,37 @@ impl Game {
o1.add_gun(&ct, content::GunHandle { index: 0 });
o1.add_gun(&ct, content::GunHandle { index: 0 });
let s = object::Ship::new(
&ct,
content::ShipHandle { index: 0 },
content::FactionHandle { index: 0 },
o1,
);
let h1 = physics.add_ship(&ct, s, Point2 { x: 0.0, y: 0.0 });
let s = object::Ship::new(
&ct,
content::ShipHandle { index: 0 },
// This method of specifying factions is non-deterministic,
// but that's ok since this is for debug.
// TODO: fix
content::FactionHandle { index: 1 },
object::OutfitSet::new(ss),
);
let h2 = physics.add_ship(&ct, s, Point2 { x: 300.0, y: 300.0 });
let mut o1 = object::OutfitSet::new(ss);
o1.add(&ct, content::OutfitHandle { index: 0 });
o1.add_gun(&ct, content::GunHandle { index: 0 });
let s = object::Ship::new(
gamedata.create_ship(
&ct,
content::ShipHandle { index: 0 },
content::FactionHandle { index: 1 },
content::FactionHandle { index: 0 },
ShipPersonality::Player,
o1,
);
let h3 = physics.add_ship(
gamedata.create_ship(
&ct,
s,
Point2 {
x: -300.0,
y: 300.0,
},
content::ShipHandle { index: 0 },
content::FactionHandle { index: 1 },
ShipPersonality::Dummy,
object::OutfitSet::new(ss),
);
let mut shipbehaviors: Vec<Box<dyn ShipBehavior>> = Vec::new();
shipbehaviors.push(Box::new(behavior::Dummy::new(h2)));
shipbehaviors.push(Box::new(behavior::Point::new(h3)));
gamedata.create_ship(
&ct,
content::ShipHandle { index: 0 },
content::FactionHandle { index: 1 },
ShipPersonality::Point,
o1,
);
//let mut shipbehaviors: Vec<Box<dyn ShipBehavior>> = Vec::new();
//shipbehaviors.push(Box::new(behavior::Dummy::new(h2)));
//shipbehaviors.push(Box::new(behavior::Point::new(h3)));
Game {
last_update: Instant::now(),
@ -103,6 +97,7 @@ impl Game {
time_scale: 1.0,
world: physics,
shipbehaviors,
gamedata,
content: ct,
playerbehavior: behavior::Player::new(h1),
new_particles: Vec::new(),

View File

@ -1,5 +1,7 @@
use galactica_content as content;
// TODO: remove. projectiles only exist in physics
#[derive(Debug)]
pub struct Projectile {
pub content: content::Projectile,