Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 2d Particle Engine
Index -> Programming, C++ -> C++ Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
zero-impact




PostPosted: 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.



particles.png
 Description:
 Filesize:  63.49 KB
 Viewed:  376 Time(s)

particles.png



Particle.zip
 Description:

Download
 Filename:  Particle.zip
 Filesize:  23.84 KB
 Downloaded:  572 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
saltpro15




PostPosted: 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?
zero-impact




PostPosted: Thu Apr 30, 2009 3:58 pm   Post subject: RE:2d Particle Engine

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




PostPosted: 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
zero-impact




PostPosted: 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.
saltpro15




PostPosted: 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?
zero-impact




PostPosted: 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!
saltpro15




PostPosted: 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!
Sponsor
Sponsor
Sponsor
sponsor
zero-impact




PostPosted: Thu Apr 30, 2009 8:01 pm   Post subject: RE:2d Particle Engine

>.<
zero-impact




PostPosted: 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.



Untitled.png
 Description:
 Filesize:  72.91 KB
 Viewed:  375 Time(s)

Untitled.png



ParticleWindows.zip
 Description:

Download
 Filename:  ParticleWindows.zip
 Filesize:  540.36 KB
 Downloaded:  440 Time(s)

ecookman




PostPosted: 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
Display posts from previous:   
   Index -> Programming, C++ -> C++ Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: