summaryrefslogtreecommitdiff
path: root/src/projectile/guruguruBarProjectile.c
blob: c1ab80cfeec754e2fad09d12d9f4c3ac7c74c217 (plain)
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
/**
 * @file guruguruBarProjectile.c
 * @ingroup Projectiles
 *
 * @brief Guruguru Bar Projectile
 */
#include "entity.h"
#include "physics.h"

void sub_080AABB0(Entity*);

void GuruguruBarProjectile(Entity* this) {
    if (this->action == 0) {
        this->action = 1;
        InitializeAnimation(this, 0);
    }
    sub_080AABB0(this);
    GetNextFrame(this);
}

void sub_080AABB0(Entity* this) {
    u32 factor;
    const s16* tmp;
    Entity* parent;

    parent = this->parent;
    CopyPosition(parent, this);

    tmp = &gSineTable[parent->animationState];
    factor = this->timer << 8;
    this->x.WORD += tmp[0] * factor;
    this->y.WORD -= tmp[0x40] * factor;
}