Sinnvolleres Spawn- und Bewegungsverhalten.
[hackover2013-badge-firmware.git] / badge / jumpnrun / shots.c
1 #include "shots.h"
2 #include "jumpnrun.h"
3 #include "render.h"
4
5 void jumpnrun_shot_process(jumpnrun_shot *shot) {
6 if(jumpnrun_shot_spawned(shot)) {
7 rectangle_move_rel(&shot->current_box, shot->inertia);
8 jumpnrun_apply_gravity(&shot->inertia);
9
10 if(fixed_point_gt(rectangle_top(&shot->current_box), FIXED_INT(BADGE_DISPLAY_HEIGHT))) {
11 jumpnrun_shot_despawn(shot);
12 }
13
14 ++shot->tick;
15 if(shot->tick == JUMPNRUN_SHOT_FRAMES * JUMPNRUN_SHOT_TICKS_PER_FRAME) {
16 shot->tick = 0;
17 }
18 }
19 }
This page took 0.042673 seconds and 5 git commands to generate.