about summary refs log blame commit diff stats
path: root/src/pong.h
blob: b847a8a09032a05d44696011bf4c9f7be796ae69 (plain) (tree)
1
2
3
4
5
6
7
8
9

              
                                           
                   
                     



                            
                            
                           



                   
                   
                   
                   
 

                   








                               
                     








                         
                     

  







                                      

                      
                               
                                      
 






                           


                                                                                                      

                   
                     
                       
                     
 
      
#ifndef PONG_H
#define PONG_H
#define MOUSE_LEFT_BUTTON MOUSE_BUTTON_LEFT
#include <raylib.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_audio.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_mutex.h>
#include <SDL2/SDL_thread.h>
#include <SDL2/SDL_atomic.h>
#include <SDL2/SDL_timer.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <time.h>
#include <setjmp.h>
#include <string.h>
#include <stdint.h>

#include "sounds.h"

#define LEFT 0
#define RIGHT 1

struct Players {
	float Y;
	Rectangle HitBox;
	int Score;
	int Direction;
	Rectangle BallDetector;
	int NextTick;
};

struct Balls {
	float X;
	float Y;
	float Angle;
	float Speed;
	int Direction;
	Rectangle HitBox;
	int NextTick;
};

struct Settings {
	int SoundVolume;
	int MusicVolume;
	int Fullscreen;
};

extern struct Settings GlobalSettings;

extern int Difficulty;
extern bool GameGoing;
extern char VersionString[256];
extern SDL_atomic_t AudioInitializing;

//Clock
extern double NewTime;
extern double OldTime;
extern double Milliseconds;
extern double DeltaTime;
extern int Ticks;

void enemy(struct Players *Enemy, struct Balls ball);
void ball(Rectangle *Player, Rectangle *Enemy, struct Balls *Ball, int *PlayerScore, int *EnemyScore);
bool play_audio(int SoundEffect);
int title_screen();
void versus_main();
void marathon_main();
void set_screen_mode();
int internal_clock();

#endif