Computer Science Canada

2d Particle Engine

Author:  zero-impact [ Thu Apr 30, 2009 3:13 pm ]
Post subject:  2d Particle Engine

I wanted to start off with graphics programming in c++ with SDL so I decided to port one of my old Turing projects found here.

Basically this was a quick and dirty excersize with terrible coding. I'm still learning c++ so I know I probably did a LOT wrong. If anyone dares to look at the code I would be very happy to hear some feedback, no matter how harsh.

There is only a linux executable included but you can compile it with
code:
g++ main.cpp -Wall -o particle `sdl-config --cflags --libs` -lSDL -lSDL_image -lSDL_ttf
if you have all the right SDL files.

If I have time I will post a windows executable later.

Screenshot is below.

The controls are left click and spacebar.

Author:  saltpro15 [ Thu Apr 30, 2009 3:46 pm ]
Post subject:  RE:2d Particle Engine

nice job! I don't see fps limiting in here anywhere, did you do it?

Author:  zero-impact [ Thu Apr 30, 2009 3:58 pm ]
Post subject:  RE:2d Particle Engine

No. I think the fps timing code is fundamentally flawed.

Author:  saltpro15 [ Thu Apr 30, 2009 7:35 pm ]
Post subject:  RE:2d Particle Engine

hmm, worked for me. your program works fine on my computer at least, compiled under ubuntu of course Wink now go practice for Provincials :p

Author:  zero-impact [ Thu Apr 30, 2009 7:41 pm ]
Post subject:  RE:2d Particle Engine

Well it works, it just isn't accurate I think.. I tried to limit the fps but it just got buggy.

I should have used a timestep based off of an actual timer to do the physics.

Author:  saltpro15 [ Thu Apr 30, 2009 7:46 pm ]
Post subject:  RE:2d Particle Engine

hmm, odd. It still can't compare to my pong Wink we still doing pac-man next?

Author:  zero-impact [ Thu Apr 30, 2009 7:53 pm ]
Post subject:  RE:2d Particle Engine

I think I remember you saying you would never post your pong game on compsci..

Anyways back on topic!

Author:  saltpro15 [ Thu Apr 30, 2009 8:00 pm ]
Post subject:  RE:2d Particle Engine

hmm, true :p but I really don't have anything to say on topic, so I think i'll just ramble on in this thread for a while until I decide it's time for a coke.


it's time!

Author:  zero-impact [ Thu Apr 30, 2009 8:01 pm ]
Post subject:  RE:2d Particle Engine

>.<

Author:  zero-impact [ Sat May 02, 2009 3:45 pm ]
Post subject:  Re: 2d Particle Engine

Ok I finally got the time to compile a windows version.
So here it is for anyone who is interested.

Author:  ecookman [ Mon Jun 01, 2009 7:17 am ]
Post subject:  RE:2d Particle Engine

Blah this is soo fun to play with...too fun DUN Dun Dunnn


: