diff --git a/examples/sokol/particles/main.v b/examples/sokol/particles/main.v index fed2e1a77f..0b6ba6f3d4 100644 --- a/examples/sokol/particles/main.v +++ b/examples/sokol/particles/main.v @@ -14,7 +14,7 @@ const ( ) fn main() { - app := &App{ + mut app := &App{ width: 800 height: 400 pass_action: gfx.create_clear_pass(0.1, 0.1, 0.1, 1.0) diff --git a/examples/sokol/particles/particle/system.v b/examples/sokol/particles/particle/system.v index 82d616b00d..ec2e7fed96 100644 --- a/examples/sokol/particles/particle/system.v +++ b/examples/sokol/particles/particle/system.v @@ -46,13 +46,15 @@ pub fn (s System) draw() { } pub fn (mut s System) reset() { - for p in s.pool { + for i in 0..s.pool.len { + mut p := s.pool[i] p.reset() p.life_time = 0 } - for p_ in s.bin { - p_.reset() - p_.life_time = 0 + for i in 0..s.bin.len { + mut p := s.pool[i] + p.reset() + p.life_time = 0 } }