This repository was archived by the owner on Oct 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-46
lines changed
enigme finale (another copy)/enigme finale (another copy) Expand file tree Collapse file tree 2 files changed +30
-46
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #ifndef ENEMY_H
2+ #define ENEMY_H
3+
4+ typedef struct
5+ {
6+ SDL_Rect img_pos ; // position of the sprite on the screen
7+ SDL_Rect img_size ; // size of the sprite
8+ SDL_Surface * img ; // pointer to the sprite image
9+ int direction ; // 0 for idle, 1 for right , 2 for left
10+ float speed ; // steps per frame
11+ int max_steps ; // maximum number of steps before changing direction
12+ int idle_time ; // time when the enemy started idling
13+ int x ; // position of the enemy in the grid (screen coordinates)
14+ int y ; // position of the enemy in the grid (screen coordinates)
15+ } enemy ;
16+
17+ void initEnemy (enemy * e );
18+ void drawEnemy (SDL_Surface * screen , enemy e );
19+ void animateEnemy (enemy * e , int direction );
20+ void moveEnemy (enemy * e ); //! added new parameter dont forget
21+ int collisionBB (SDL_Rect player , SDL_Rect enemy );
22+
23+ //****************************************************
24+
25+ void initEnemytest (enemy * e );
26+ void drawEnemytest (SDL_Surface * screen , enemy e );
27+ void animateEnemytest (enemy * e , int direction );
28+ void moveEnemytest (enemy * e );
29+
30+ #endif
You can’t perform that action at this time.
0 commit comments