Skip to content
Snippets Groups Projects
Commit 36b3c6c1 authored by antoinemeyer5's avatar antoinemeyer5
Browse files

nouvelle map, ajout de la balle

parent 880ffd53
Branches
No related tags found
No related merge requests found
......@@ -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 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"
//ball_t ball;
ball_t ball;
int trajectoireAntoine[NUMBERPOINT_TRAJEC][2];
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)
......
......@@ -6,6 +6,8 @@
#include <stdio.h>
#include <math.h>
#include "render.h"
#define NUMBERPOINT_TRAJEC 50
typedef enum
......@@ -16,14 +18,17 @@ typedef enum
typedef struct ball
{
int x;
int y;
int z;
float x;
float y;
float z;
int h;
int w;
int isHit;
float angle;
float speed;
int speed;
} ball_t;
//extern ball_t ball;
extern ball_t ball;
extern int trajectoireAntoine[NUMBERPOINT_TRAJEC][2];
void initBall();
......
......@@ -14,6 +14,7 @@ int main(){
//printMap();
initPlayer();
initKeys();
initBall();
mainLoop();
......
......@@ -5,7 +5,7 @@
#define MAP_WIDTH 31
#define MAP_HEIGHT 17
#define MAP_HEIGHT 10
extern int map[MAP_HEIGHT][MAP_WIDTH];
......
#include "player.h"
player_t player;
player_t ennemy;
player_t ball;
int *landingPoint;
int *lastHitPoint;
......@@ -21,10 +18,6 @@ void initPlayer()
ennemy.x = 20 * BLOCK_SIZE;
ennemy.y = 10 * BLOCK_SIZE;
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.isMoving = 0;
player.HPMax = 3;
......@@ -34,10 +27,6 @@ void initPlayer()
player.deltax = 1;
player.deltay = 0;
player.viewAngle = 0;
ball.z = player.h/BLOCK_SIZE;
ball.isHit = 0;
ball.speed = 0;
ball.angle = -pi;
}
int *generateLandingPoint()
......
......@@ -36,7 +36,6 @@ typedef struct player{
extern player_t player;
extern player_t ennemy;
extern player_t ball;
void initPlayer();
void managePlayer();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment