Skip to content
Snippets Groups Projects
Commit e3831d75 authored by Taha Belkhiri's avatar Taha Belkhiri
Browse files

Merge branch 'render' of github.com:maberet/ProjetZZ1 into render

parents 1aa7513a 6664f481
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,4 @@ ...@@ -7,11 +7,4 @@
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
\ No newline at end of file
#include "ball.h" #include "ball.h"
//ball_t ball; ball_t ball;
int trajectoireAntoine[NUMBERPOINT_TRAJEC][2]; int trajectoireAntoine[NUMBERPOINT_TRAJEC][2];
void initBall() void initBall()
{ {
ball.x = 5 * BLOCK_SIZE;
ball.y = 5 * BLOCK_SIZE;
ball.z = player.h/BLOCK_SIZE;
ball.h = 0.5 * BLOCK_SIZE;
ball.w = 0.5 * BLOCK_SIZE;
ball.isHit = 0;
ball.angle = -pi;
ball.speed = 0;
} }
float defineAngle(int canonX, int canonY, int xDropPoint, int yDropPoint) float defineAngle(int canonX, int canonY, int xDropPoint, int yDropPoint)
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include "render.h"
#define NUMBERPOINT_TRAJEC 50 #define NUMBERPOINT_TRAJEC 50
typedef enum typedef enum
...@@ -16,14 +18,17 @@ typedef enum ...@@ -16,14 +18,17 @@ typedef enum
typedef struct ball typedef struct ball
{ {
int x; float x;
int y; float y;
int z; float z;
int h;
int w;
int isHit;
float angle; float angle;
float speed; int speed;
} ball_t; } ball_t;
//extern ball_t ball; extern ball_t ball;
extern int trajectoireAntoine[NUMBERPOINT_TRAJEC][2]; extern int trajectoireAntoine[NUMBERPOINT_TRAJEC][2];
void initBall(); void initBall();
......
...@@ -14,6 +14,7 @@ int main(){ ...@@ -14,6 +14,7 @@ int main(){
//printMap(); //printMap();
initPlayer(); initPlayer();
initKeys(); initKeys();
initBall();
mainLoop(); mainLoop();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define MAP_WIDTH 31 #define MAP_WIDTH 31
#define MAP_HEIGHT 17 #define MAP_HEIGHT 10
extern int map[MAP_HEIGHT][MAP_WIDTH]; extern int map[MAP_HEIGHT][MAP_WIDTH];
......
#include "player.h" #include "player.h"
player_t player; player_t player;
player_t ennemy; player_t ennemy;
player_t ball;
int *landingPoint; int *landingPoint;
int *lastHitPoint; int *lastHitPoint;
void initPlayer() void initPlayer()
{ {
player.x = 6 * BLOCK_SIZE; player.x = 3 * BLOCK_SIZE;
player.y = 6 * BLOCK_SIZE; player.y = 5 * BLOCK_SIZE;
player.h = 2 * BLOCK_SIZE; player.h = 2 * BLOCK_SIZE;
player.w = 2 * BLOCK_SIZE; player.w = 2 * BLOCK_SIZE;
player.angle = 0; player.angle = 0;
ennemy.h = 2 * BLOCK_SIZE; ennemy.h = 2 * BLOCK_SIZE;
ennemy.w = 2 * BLOCK_SIZE; ennemy.w = 2 * BLOCK_SIZE;
ennemy.x = 20 * BLOCK_SIZE; ennemy.x = 25 * BLOCK_SIZE;
ennemy.y = 10 * BLOCK_SIZE; ennemy.y = 5 * BLOCK_SIZE;
ennemy.angle = -pi; ennemy.angle = -pi;
ball.h = 0.5 * BLOCK_SIZE;
ball.w = 0.5 * BLOCK_SIZE;
ball.x = 10 * BLOCK_SIZE;
ball.y = 10 * BLOCK_SIZE;
player.speed = 1; player.speed = 1;
player.isMoving = 0; player.isMoving = 0;
player.HPMax = 3; player.HPMax = 3;
...@@ -34,10 +27,6 @@ void initPlayer() ...@@ -34,10 +27,6 @@ void initPlayer()
player.deltax = 1; player.deltax = 1;
player.deltay = 0; player.deltay = 0;
player.viewAngle = 0; player.viewAngle = 0;
ball.z = player.h/BLOCK_SIZE;
ball.isHit = 0;
ball.speed = 0;
ball.angle = -pi;
} }
int *generateLandingPoint() int *generateLandingPoint()
......
...@@ -36,7 +36,6 @@ typedef struct player{ ...@@ -36,7 +36,6 @@ typedef struct player{
extern player_t player; extern player_t player;
extern player_t ennemy; extern player_t ennemy;
extern player_t ball;
void initPlayer(); void initPlayer();
void managePlayer(); void managePlayer();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment