Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // EVERY FRAME
- // EVERY FRAME
- // EVERY FRAME
- // EVERY FRAME
- struct s_projectile
- {
- s_v2 pos;
- };
- static s_sarray<s_projectile, 1024> projs;
- static s_random rng = zero;
- if(is_key_pressed(key_space, true))
- {
- s_projectile p = zero;
- p.pos.y = rng.randf() * c_world_size.y;
- projs.add(p);
- }
- foreach(proj_i, proj, projs)
- {
- s_v2 size = v2(64);
- draw_rect_ui(proj->pos, 0, size, WHITE);
- proj->pos.x += 400 * delta;
- int emitter = make_trigger_altar_particles(&game->ui_particle_emitters, v3(proj->pos + size / 2, -1), null);
- if(proj->pos.x > 2000)
- {
- projs.remove_and_swap(proj_i--);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement