Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
[5]
Figure: Example rock paper scissors game
Goal
The goal of Rock Paper Scissors is to choose the item (rock, paper
or scissors) which defeats your opponent’s chosen item.
Setup
Players face each other and create a fist using the hand they will
use to play.
Gameplay
PROGRAM
int x, y, z;
int bx = p_x;
int by = p_y;
int index=0;
bx = p_x;
by = p_y;
index = g_tilemap.Get( x, y, z );
if( index != -1 )
bx += TILESIZE;
bx = p_x;
by += TILESIZE;
{
int a;
int b;
crude= 5*b + a;
return crude;
// declare coordinates.
int x, y;
SDL_Event event;
atexit( SDL_Quit );
while (check1 == 0)
while ( 1)
SDL_UpdateRect( g_window, 0, 0, 0, 0 );
check1= 1;
break;
while ( check1 == 1 )
while ( 1)
SDL_UpdateRect( g_window, 0, 0, 0, 0 );
check1= 2;
break;
while ( check1 == 2 )
while ( 1)
SDL_UpdateRect( g_window, 0, 0, 0, 0 );
check1= 3;
break;
{
g_tilemap.Get( x, y, 0 ) = 0; //rand() % 4;
g_tilemap.Get(4, 3, 0 ) = 8; g_tilemap.Get( 4, 4, 0 ) = 7;
g_tilemap.Get( 0, 3, 0 ) = 6; g_tilemap.Get( 1, 3, 0 ) = 5;
g_tilemap.Get( 2, 3, 0 ) = 4; g_tilemap.Get( 1, 4, 0 ) = 3;
g_tilemap.Get( 2, 2, 0 ) = 2; g_tilemap.Get( 2, 1 , 0 ) = 1;
g_tilemap.Get(2,0,0) =8;
g_tilemap.Get( x, 2, 0 ) = 1;
g_tilemap.Get( x, 6, 0 ) = 1;
g_tilemap.Get( 1, y, 0 ) = 1;
g_tilemap.Get(4 , y, 0 ) = 1;
*/
{
for( x = 0; x < MAPWIDTH; x++ )
g_tilemap.Get( x, y, 1 ) = -1;
x=0;
y=0;
over=0;
while( evention )
break;
x= x/64;
y= y/64;
crud(x, y);
if (crude ==15 )
move1 =1;
rock= SDL_LoadBMP( "rockleft.bmp" );
move1 =2;
move1 = 3;
mode =0;
g_tilemap.Get(2,0,0) =8;
break;
mode = 1;
g_tilemap.Get(2,0,0) =7;
else{}
move2 = 2;
if (crude ==15 )
move1 =1;
move1 =2;
move1 = 3;
if (move1 == 1 || move2 == 2)
score2++;
{
score1++;
score2++;
score1++;
score2++;
score1++;
else
//draw
SDL_Event quit;
quit.type = SDL_QUIT;
SDL_PushEvent( &quit );
g_dy += SCROLL;
g_dy -= SCROLL;
g_dx += SCROLL;
g_dx -= SCROLL;
g_dy -= SCROLL;
g_dx -= SCROLL;
g_dx += SCROLL;
g_x += g_dx;
g_y += g_dy;
SDLBlit(rock, g_window, 0, 64 );
SDL_UpdateRect( g_window, 0, 0, 0, 0 );
// done
return 0;
O Tiling manipulation
O Key press manipulation with the esc key
O Has menu
O Color Keying
Although the game was created in a simple manner, the mere concept
of Artificial Intelligence was prevalent in the program. There are menus, like
the exit button, which gave more life to the game. Though, the game can be
better improved on the visuals, and also smoother flow of the game. Even if
the game uses simple AI and graphics, it is a fun game that is sure to enjoy
people during their breaks.
V. REFERENCES