Simple 3d pong game

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
Xaryl
Posts: 90
Joined: Sat Apr 30, 2011 11:54 pm

Simple 3d pong game

Post by Xaryl »

As a warm up, I made this little pong game.

Image

Game play:
The left player uses wasd, and the right player uses the arrow keys to control.
Keep the ball in front of your paddle.

Download source code here
Run with the media folder at current working directory.

I apologise for occasional abuse of public variables instead of creating wrapping functions,
and a couple obscure variable names :p

As it is just a random thing I put together, I am not really interested in fixing bugs, but feel free to report bugs if you think it would be useful for the others.

Edit:
Some fixes
Last edited by Xaryl on Mon May 30, 2011 3:07 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

You linked it hard to /home/schlaflos/irrKlang-1.3.0/bin/linux-gcc/libIrrKlang.so so can't start it here. Also sources are without makefile or similar, you should add those.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
omg_fail
Posts: 83
Joined: Wed Apr 20, 2011 1:14 pm
Location: Germany/Bavaria
Contact:

Post by omg_fail »

Nice :D

;D
/home/schlaflos/irrKlang-1.3.0/
How many hours did you need ?
Xaryl
Posts: 90
Joined: Sat Apr 30, 2011 11:54 pm

Post by Xaryl »

CuteAlien wrote:You linked it hard to /home/schlaflos/irrKlang-1.3.0/bin/linux-gcc/libIrrKlang.so so can't start it here.
Some stupid noob (finger pointing at self) added that in the IDE even though the program has no sound at all :/
CuteAlien wrote:Also sources are without makefile or similar, you should add those.
Makefile and code::blocks project file are added, but they are compiler dependent (gcc) because the irrlicht library files included.

For other compilers and IDEs, just add everything in src folder to the project and do the usual including path and linking with irrlicht if needed.

The Makefile should work under windows and unix like systems.
For tricky environment like cygwin, the target needs to be set specifically with

Code: Select all

make linux
or

Code: Select all

make windows
omg_fail wrote:How many hours did you need ?
I can only wish that I have 36 hours in a day, but still then I will somehow not have enough ><
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Simple 3d pong game

Post by Asimov »

Hi Xaryl,

Is this source code still available? I am drinking in any source code I can find to learn from.
I tried the link, but I believe it is dead. Well it leads me to a page with some German writing, and my language skills are nacht gut :D

Asimov
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Simple 3d pong game

Post by netpipe »

http://sourceforge.net/p/irrdemos/code/ ... mos/Games/ if its not in there i probably havnt gotten to putting it in in the last 2 years i collected alot of stuff over the years its getting more overwhelming as i keep making the folders i stick random things in with odd names. maybe an update sometime next year
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Simple 3d pong game

Post by Asimov »

Hi Tecan,

Thanks I got it. Not compiled it yet. Will do it later. I learn better from looking through code than anything.
I know C++ but just getting to grips with this new engine.
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Simple 3d pong game

Post by Asimov »

Hi Tecan,

So far haven't managed to compile your examples, mainly because I am having a problem with getting irrlicht to work with directx, but nevertheless your code is a learning experience.

For instance now I know you can send a pointer of the node into a function or class eg ISceneNode* ball
So looking at that if I made a class I could then send a pointer of the ball into my class and update it's location in the 3d world.
I have a lot to learn, before I can make my game I am planning but thanks anyway.
Post Reply