aboutsummaryrefslogtreecommitdiff
path: root/src/entities/antifaShip.c
blob: f43a7dff9ab5ab643af403468b4837f0b06147e3 (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
#include "antifaShip.h"
#include "game.h"

void initAntifaShip(Entity * entity, Game * game) {
	entity->model = &game->assets.models[ANTIFA_SHIP_ASSET];

	entity->useAcceleration = true;
	entity->acceleration = (EntityAcceleration){
		.speedUp = 30.0,
		.speedDown = 15,
		.rotation = (Vector3){0.7, 0.7, 0.7}
	};
}

void closeAntifaShip(Entity * entity) {
}

void updateAntifaShip(Game * game, Entity * entity, EntityId id) {
	Vector3 stick = (Vector3){
		GetGamepadAxisMovement(0, 1),
		-GetGamepadAxisMovement(0, 0),
		GetGamepadAxisMovement(0, 2) * 0.25
	};

	stick = Vector3Scale(stick, 0.5);

	entityJoystickControl(entity, stick, fabs(GetGamepadAxisMovement(0, 3) * 300.0));
}

void drawAntifaShip(Game * game, Entity * entity, EntityId id) {
	entityDraw(entity);
}