-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.nbis
More file actions
40 lines (36 loc) · 964 Bytes
/
Copy pathstructs.nbis
File metadata and controls
40 lines (36 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from si import *
import random
from consts import *
# Rocket State & Controls
struct Rocket {
# State
x: Length = random.uniform(-140.0m, 140.0m),
y: Length = -450.0 m,
vx: Velocity = random.uniform(-35.0 m/s, 35.0 m/s),
vy: Velocity = random.uniform(30.0 m/s, 60.0 m/s),
angle: Angle = random.uniform(-0.4 rad, 0.4 rad),
omega: AngularVelocity = random.uniform(-0.2 rad/s, 0.2 rad/s),
fuel: Mass = INITIAL_FUEL,
mass: Mass = DRY_MASS + INITIAL_FUEL,
# Controls
engine_on: Bool = false,
rcs_left: Bool = false,
rcs_right: Bool = false,
}
# Platform params
struct Platform {
x: Length = random.uniform(-SCREEN_WIDTH_M/2 + MARGIN, SCREEN_WIDTH_M/2 - PLATFORM_WIDTH - MARGIN),
y: Length = -5.0 m,
w: Length = PLATFORM_WIDTH,
h: Length = 5.0 m,
}
# Particles
struct Particle {
x: Length,
y: Length,
vx: Velocity,
vy: Velocity,
life: Time,
max_life: Time,
color: Str
}