Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A (single|multi)-player AirHockey game written in OpenGL

branch: master

\0

latest commit bfa266b258
krisa authored February 14, 2012
Octocat-spinner-32 resources Done January 05, 2012
Octocat-spinner-32 README Done January 05, 2012
Octocat-spinner-32 Transformation.cpp Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 Transformation.h Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 Utilities.cpp Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 Utilities.h Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 bat_models.cpp Done January 05, 2012
Octocat-spinner-32 bat_models.h Added bat_models. Fix the colors June 10, 2011
Octocat-spinner-32 cbat.cpp Done January 05, 2012
Octocat-spinner-32 cbat.h Done January 05, 2012
Octocat-spinner-32 cboard.cpp Done January 05, 2012
Octocat-spinner-32 cboard.h temp November 27, 2011
Octocat-spinner-32 cbutton.cpp Buttons or singleplayer and multiplayer and exit working. Must start … June 08, 2011
Octocat-spinner-32 cbutton.h Buttons or singleplayer and multiplayer and exit working. Must start … June 08, 2011
Octocat-spinner-32 ccamera.cpp \0 February 14, 2012
Octocat-spinner-32 ccamera.h fixed non-fullscreen screen size. gave up on msaa, need to look at ac… July 29, 2011
Octocat-spinner-32 cfontprinter.cpp networking done, ui done, i guess September 28, 2011
Octocat-spinner-32 cfontprinter.h networking done, ui done, i guess September 28, 2011
Octocat-spinner-32 cgame Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 cgame.cpp Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 cgame.h Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 clabel.cpp Done January 05, 2012
Octocat-spinner-32 clabel.h Done January 05, 2012
Octocat-spinner-32 cnetwork_queue.cpp networking part working; need to write physics now October 03, 2011
Octocat-spinner-32 cnetwork_queue.h networking part working; need to write physics now October 03, 2011
Octocat-spinner-32 cpacketdata.h temp December 08, 2011
Octocat-spinner-32 cpanel.cpp Done January 05, 2012
Octocat-spinner-32 cpanel.h Done January 05, 2012
Octocat-spinner-32 cpanelobjek.cpp networking done, ui done, i guess September 28, 2011
Octocat-spinner-32 cpanelobjek.h networking done, ui done, i guess September 28, 2011
Octocat-spinner-32 cplayer.cpp score works; physics slightly better; 2 player works November 07, 2011
Octocat-spinner-32 cplayer.h score works; physics slightly better; 2 player works November 07, 2011
Octocat-spinner-32 cpuck.cpp added sound support; added basic themes support November 15, 2011
Octocat-spinner-32 cpuck.h Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 csoundplayer.cpp temp November 22, 2011
Octocat-spinner-32 csoundplayer.h temp November 22, 2011
Octocat-spinner-32 ctextinput.cpp networking done, ui done, i guess September 28, 2011
Octocat-spinner-32 ctextinput.h networking done, ui done, i guess September 28, 2011
Octocat-spinner-32 ctexture.cpp Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 ctexture.h Done January 05, 2012
Octocat-spinner-32 ctheme.cpp Done January 05, 2012
Octocat-spinner-32 ctheme.h Done January 05, 2012
Octocat-spinner-32 dump scripting for single_player working beautifully November 13, 2011
Octocat-spinner-32 dump1 score works; physics slightly better; 2 player works November 07, 2011
Octocat-spinner-32 dump2 score works; physics slightly better; 2 player works November 07, 2011
Octocat-spinner-32 game_mainmenu.h Done January 05, 2012
Octocat-spinner-32 game_over.h Done January 05, 2012
Octocat-spinner-32 game_paused.h Done January 05, 2012
Octocat-spinner-32 game_running.h \0 February 14, 2012
Octocat-spinner-32 globalDefs.h temp December 07, 2011
Octocat-spinner-32 main (copy) Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 main.cpp Done January 05, 2012
Octocat-spinner-32 main.h Done January 05, 2012
Octocat-spinner-32 makefile Fix to compile and link on ubuntu 11.10 [gcc (Ubuntu/Linaro 4.6.1-9ub… February 14, 2012
Octocat-spinner-32 models.cpp \0 February 14, 2012
Octocat-spinner-32 models.h temp November 27, 2011
Octocat-spinner-32 network_client.h networking part working; need to write physics now October 03, 2011
Octocat-spinner-32 network_server.h networking part working; need to write physics now October 03, 2011
Octocat-spinner-32 networking.h Done January 05, 2012
Octocat-spinner-32 poller.h fixed non-fullscreen screen size. gave up on msaa, need to look at ac… July 29, 2011
Octocat-spinner-32 puck_models.cpp Done January 05, 2012
Octocat-spinner-32 puck_models.h added sound support; added basic themes support November 15, 2011
Octocat-spinner-32 safe__game_mainmenu.h Working splash-screen. Working button-animations (popups). Working cu… June 06, 2011
Octocat-spinner-32 safe__game_running.h Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 safe__game_running2.h Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 safe__game_running3.h_new_vectors_pdf_working.h Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 tags Physics workign beautifully; changed everything to vectors November 05, 2011
Octocat-spinner-32 temp_script.cpp scripting for single_player working beautifully November 13, 2011
Octocat-spinner-32 themes.h temp December 07, 2011
Octocat-spinner-32 vim2Session.vim Done January 05, 2012
Octocat-spinner-32 vimSession.vim Done January 05, 2012
README
#############################################################################################################################

## To compile, hit make
## To run, hit ./main

#############################################################################################################################

## Requires : SDL, SDL_image, SDL_net, freeglut

#############################################################################################################################

## Todo : 

V# Support Resize! and/or fullscreen
V# Increase mouse sensitivity in MainMenu? 
V# Custom music
## Change the poller (eventManager) to 'bite off' more than 20 events at once
V# Investigate memory leaks in ftgl code
V# Add entry and exit functions in each gamestate that are called on each gamestate switch 
## Make display lists out of mainmenu pictures, and the bats, and the puck

## Anti-aliasing : 
## 	Investigate GL_MULTISAMPLE_ARB, , needs to create window with that pixel format? 
## 	Try w/ bigger objects, and bigger clipping volume, in the same window
##	Fall back to accum buffer smoothing

V# Make player and bats and puck inits callable from game_mainmenu on transition to game_running
V# i.e., Add single-use-only pattern to all loadModels( ) functions

V# Add NetworkProgramming threads
## Add error checking while initialising each module, so that the game can still be played w/o 
## certain modules, (example : networking, anti-aliasing)

V# *** Can't run more than 1 instance of AirHockey at once!!! 
V#     Fixed the Networking part (try to bind to another socket)
V#     Some issue w/ peepEvents : peepEvents fails when another udp server is running on the same socket_number
##     !!! cleanUP() in NSGame* doesn't work, , and causes SDL_PeepEvents to fail
## Looks fine now. Soln. : try to bind to 2000, and if failed, try to bind to 6000

## Move applicable stuff into globalDefs.h
## Change class member definitions from public to private where applicable

V# Add textboxs for input and for credits etc
V# Add controls in game_settings.h ? or keep it in game_mainmenu.h ? [edit : looks like it'll stay in game_mainmenu.h, for now]
V# Have added some basic UI elements (FontPrinter, Panel, TextInput)
V# Have the sub-buttons pop up in the middle of the screen w/ a CPanel around them
V# Let CTextInput remain a CPanelObjek
V# Add highlight/popout support for clabel
V# Add pointLiesWithin/click supprot for cpanel
## TextInput is numeric and periods only for now (ip address)
V# Add inputDoneHandler to TextInput
## !! Panel.enable/disableChildren doesn't work
V# Add "enter remote server's ip address" label
V# Add backspace support to TextInput
## Add appropriate errorHandling to checkIpAddr( ) 
V# Make sure that clicking on multiplayer_panel does not make it vanish; basically, add clickHandler for Panel and set it empty here
## Handle SDL_WM_GrabInput correctly to support multiplayer game on the same system;
#  basically by allowing 'esc' to come out of GrabInput; perhaps have 'esc' place the game in PAUSE mode AND release Grab. seems like a good idea
#  perhaps, have GrabInput as a user defined option? seems like a good idea
V# Also, w/ reduced mouse_sensitivity, the bat doesn't move all the way to left until it is moved all the way to the right at least once; investigate
## Adjust Font to adjust w/ screen_size

## Physics
V# Puck's motion (vector)
V# Bats'  motion (vector)
V# Collission of bats w/ wall
V# Collission of puck w/ wall
V# Collission of bats w/ puck
   http://en.wikipedia.org/wiki/Inelastic_collision
   http://en.wikipedia.org/wiki/Elastic_collision
V# Take care of bats' motion when the bat has the puck pinned against a wall
## Fix the spinning thing. Will it go away w/ lesser work_thread_anim_delay_msecs?
#	Have changed epsilon to 2*epsilon while dealing w/ bat2 in pauli(); this seems to help, somewhat
#	Explore adding a new MOVE in make_plan() to help reduce this problem
V# Make sure that bat cannont move "over" the puck
V# Predictive collission handling to prevent bat from moving "over" puck and puck from going "into" walls
V# Convert everything to vectors
V# Add elastics to bat motion
V# Make sure initial position of the elastic is centered over the bat
## Fix MAX_BAT_SPEED to be configurable as "friction" (note: range-space: 1.5 - 6.0) (Note: will be needed if WM_Grab_Input() will be used)
## FIX BUFFER_FACTOR_FOR_COLLISSION_DETECTION to real value
V# Bat2's y velocity is too high after changing work_thread_anim_delay_msecs from 40 to 10. Check
## Have reduced bat's mass from 4.25 to 0.25 : this reduces the "spinning" thing, and makes the collissiions more inelastic

## Revisit the bounding conditions for goal checking

V# AI for when playing singleplayer mode

## Check if mouse/bat binding is good enough on any system; think about it

## Add throttle to networking delay so as not to inundate a slow network with too many packets
## Add throttle/skip if too many msgs backed up for sending in NetworkQueue;
#  or have a feedback between num_msgs_backed_up_for_sending and ticks in game_running.h
V# Add seqNum support
## Add /smart/ seqNum handling

## If the server exe is not started before the client exe, it won't connect (at least on a single comp)

## Support themes in settings; or add themes.conf to main directory
V# Make more themes
V# Add background color in themes

## Add in settings:
V# theme, music_volume, soundEffects_volume, mouse_sensitivity, friction, difficulty level
V# Change settings panel to contain key bindings info
## Add an on-disk settings.conf file to keep settings persistent, and add friction, inelasticity, etc there

V# Esc should come back to main_menu, or something
V# Add in game timer, and end condition for game on number of goals

V# Change board_color to 1.0 in mainmenu

## Finally, in production build :
	debug = 1
	MOUSE_SENSITIVITY = 1/7.0
	WM_Grab_Input in game_Running should be true in entryFunction()

V# !! Decrease work_thread_anim_delay_msecs to 10
## Check the time taken for work_thread_anim_delay_msecs to execute in ms

## Change puck's specular highlights and change disney's puck color to black

## Cannot have back-to-back multiplayer games

#############################################################################################################################


http://content.gpwiki.org/index.php/SDL:Tutorials:Setup
http://forums.libsdl.org/viewtopic.php?t=7551&sid=5cafdbd040f9e60c88ce9ae062746389


## On windows :
# Puck color is white w/ low res
# Change mp3 to wav
  fixed w/ smpeg.dll
# Networking not working
# Try increasing the frame_rate on rendering thread
# Write a windows README
V "credits"
# Color doesn't come back to white in mainMenu
# Remove all printfs
Something went wrong with that request. Please try again.