Ajout de Task projectil

Remplissage de la liste des missiles et test si les missiles touches. Remplissage de la queue_N pour tuer le joueur.

Ajout d'une animation en cas de collision ?
This commit is contained in:
Thomas 2021-04-13 20:00:07 +02:00
parent c0b156e070
commit 9c28bf0677
8 changed files with 51372 additions and 51205 deletions

View file

@ -1,4 +1,4 @@
635E684B79701B039C64EA45C3F84D30=CA3D7F5B74D23BB249A63D9AEFB759CA
8DF89ED150041C4CBC7CB9A9CAA90856=97BE6964F306799AFB7A9F5FF625EF7F
DC22A860405A8BF2F2C095E5B6529F12=97BE6964F306799AFB7A9F5FF625EF7F
8DF89ED150041C4CBC7CB9A9CAA90856=786F7A4E7FD721DD7DA504061EFBB9FE
DC22A860405A8BF2F2C095E5B6529F12=27012316FF7CB74C53C654C2433BBA42
eclipse.preferences.version=1

View file

@ -1677,9 +1677,25 @@ void f_projectile(void const * argument)
const TickType_t xPeriodeTache = 10;
/* Infinite loop */
struct Missile liste_missile[50];
struct Missile missile;
uint8_t indice = 0;
for (;;)
{
xQueueReceive(Queue_NHandle, &missile, 0);
liste_missile[indice++] = missile;
for (int i=0;i<= indice;i++)
{
liste_missile[i].x = liste_missile[i].dx + liste_missile[i].x;
liste_missile[i].y = liste_missile[i].dy + liste_missile[i].y;
if ((liste_missile[i].x == joueur.x)&&(liste_missile[i].y == joueur.y))
{
xQueueSend(Queue_JHandle, &liste_missile+indice,0);
// TODO Une petite animation d'explosion ?
}
}
vTaskDelayUntil(&xLastWakeTime, xPeriodeTache);
}
/* USER CODE END f_projectile */

Binary file not shown.

View file

@ -25,6 +25,6 @@ main.c:1543:5:envoie_score 16 static
main.c:1559:6:f_GameMaster 24 static
main.c:1587:6:f_Joueur_1 80 static
main.c:1653:6:f_block_enemie 24 static
main.c:1673:6:f_projectile 528 static
main.c:1696:6:HAL_TIM_PeriodElapsedCallback 16 static
main.c:1713:6:Error_Handler 4 static,ignoring_inline_asm
main.c:1673:6:f_projectile 544 static
main.c:1712:6:HAL_TIM_PeriodElapsedCallback 16 static
main.c:1729:6:Error_Handler 4 static,ignoring_inline_asm

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff