Module objects stdlib

objects
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
4
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn get_params

fn get_params() &UIParams

#fn random_color

fn random_color() gx.Color

#fn random_vector_in_circle

fn random_vector_in_circle() Vector

Structs

#struct UIParams

pub struct UIParams {
pub mut:
	dpi_scale       f32    = 1.0
	width           int    = 800
	height          int    = 800
	gravity         Vector = Vector{0, -0.03}
	age_rate        int    = 1
	offspring_count int    = 100
	rocket_radius   int    = 5
	particle_radius f32    = 2.5
	drag            f32    = 0.98
}

#struct Particle

pub struct Particle {
pub mut:
	color    gx.Color
	pos      Vector
	vel      Vector
	accel    Vector
	lifespan f32 = 255
}

#fn (Particle) draw

fn (particle Particle) draw(mut ctx &gg.Context)

#fn (&Particle) tick

fn (mut particle &Particle) tick(mut rocket &Rocket, mut ctx &gg.Context)

#struct Rocket

pub struct Rocket {
pub mut:
	color     gx.Color
	pos       Vector
	vel       Vector
	accel     Vector
	exploded  bool
	particles []Particle
	dead      bool
}

#fn new_rocket

fn new_rocket() Rocket

#fn (Rocket) draw

fn (rocket Rocket) draw(mut ctx &gg.Context)

#fn (&Rocket) explode

fn (mut rocket &Rocket) explode()

#fn (&Rocket) tick

fn (mut rocket &Rocket) tick(mut ctx &gg.Context)

#fn (&Rocket) spawn_particle

fn (mut rocket &Rocket) spawn_particle()

#struct Vector

pub struct Vector {
pub mut:
	x f32
	y f32
}

#fn (Vector) operator+

fn (a Vector) + (b Vector) Vector

#fn (Vector) mult

fn (vector Vector) mult(scalar f32) Vector

Interfaces

This section is empty.

Enums

This section is empty.