Pong em c

292 palavras 2 páginas
Pong em C

#include
#include
#include

/*Include the pong header file for the finding things in the datafile*/
#include "pong.h"

#define pong_ball 0 /* RLE */
#define pong_bar 1 /* RLE */
#define pong_boing 2 /* SAMP */
#define pong_pal 3 /* PAL */
#define pong_text 4 /* FONT */
#define pong_COUNT 5

/*Direction consts*/
#define DOWN_RIGHT 0
#define UP_RIGHT 1
#define DOWN_LEFT 2
#define UP_LEFT 3

/*Get the Pong DataFile*/
DATAFILE *pong_datafile=NULL;

/*Game variables*/ int bar1_y=30; //Player 1 Bar position int bar2_y=430; //Player 2 Bar position

int ball_x; //The location of the Ball int ball_y; //The location of the Ball int direction=0; //The direction the Ball is going

int score_p1=0; //Player 1 score int score_p2=0; //Plater 2 score

BITMAP *buffer; //The screen buffer of double buffering

int speed=2; //The speed of the Ball

int amout_of_hits=0; //Used to set the speed of the Ball

int up_ran_speed=0; //Random speed

/******************************************************** *NAME:Boing * *PURPOSE:To play the sound file when the ball is hit * *INPUT: N/A * *RETURN: N/A * *******************************************************/ void boing(void)
{
play_sample(pong_datafile[pong_boing].dat,255,255,1000,0); return;
}

/******************************************************** *NAME:Random Direction * *PURPOSE:To send back a random direction for the ball * *INPUT: N/A * *RETURN: An int for the direction *

Relacionados

  • Ping-Pong no recreio
    1086 palavras | 5 páginas
  • redes
    1964 palavras | 8 páginas
  • Investimentos Contabeis de mais e menos valia
    306 palavras | 2 páginas
  • ANÁLISE DO COEFICIENTE DE RESTITUIÇÃO DE DUAS BOLAS DISTINTAS ATRAVÉS DO ESPECTRO SONORO CAPTADO POR CADA QUIQUE DAS MESMAS
    2391 palavras | 10 páginas
  • Experimento Hercílio Luz - Queda Livre
    2794 palavras | 12 páginas
  • Experimento 4 - Coeficiente de Restituição
    2789 palavras | 12 páginas
  • TESTE
    3599 palavras | 15 páginas
  • Biotecnologia
    2993 palavras | 12 páginas
  • niveis de danos de virus
    2233 palavras | 9 páginas
  • relatório pêndulo simples
    919 palavras | 4 páginas