breakout enemy update
This commit is contained in:
parent
7d0f4a233c
commit
ad71177251
2 changed files with 26 additions and 18 deletions
17
src/enemytypes.h
Normal file
17
src/enemytypes.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
void updateEnemyOne(u8 i){
|
||||
if(enemies[i].clock % 20 == enemies[i].ints[0]){
|
||||
struct bulletSpawner spawner = {
|
||||
.x = enemies[i].pos.x,
|
||||
.y = enemies[i].pos.y,
|
||||
.anim = 6 + (random() % 3),
|
||||
// .frame = 1,
|
||||
.speed = FIX32(4),
|
||||
.angle = random() % 128,
|
||||
};
|
||||
if(random() % 2 < 1) spawner.anim += 3;
|
||||
for(u8 j = 0; j < 8; j++){
|
||||
spawnBullet(spawner, EMPTY);
|
||||
spawner.angle += 128;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue