Author |
Message |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
Posted: 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.
Description: |
|
Filesize: |
63.49 KB |
Viewed: |
455 Time(s) |
![particles.png](uploads/attachments/thumbs/t_particles_714.png)
|
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
Particle.zip |
Filesize: |
23.84 KB |
Downloaded: |
646 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
Posted: 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?
|
|
|
|
|
![](images/spacer.gif) |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
Posted: Thu Apr 30, 2009 3:58 pm Post subject: RE:2d Particle Engine |
|
|
No. I think the fps timing code is fundamentally flawed.
|
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
Posted: 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 now go practice for Provincials :p
|
|
|
|
|
![](images/spacer.gif) |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
Posted: 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.
|
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
Posted: Thu Apr 30, 2009 7:46 pm Post subject: RE:2d Particle Engine |
|
|
hmm, odd. It still can't compare to my pong we still doing pac-man next?
|
|
|
|
|
![](images/spacer.gif) |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
Posted: 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!
|
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
Posted: 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!
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
Posted: Thu Apr 30, 2009 8:01 pm Post subject: RE:2d Particle Engine |
|
|
>.<
|
|
|
|
|
![](images/spacer.gif) |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
Posted: 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.
Description: |
|
Filesize: |
72.91 KB |
Viewed: |
436 Time(s) |
![Untitled.png](uploads/attachments/thumbs/t_untitled_101.png)
|
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
ParticleWindows.zip |
Filesize: |
540.36 KB |
Downloaded: |
535 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
ecookman
![](http://compsci.ca/v3/uploads/user_avatars/5690458955648ca661c338.gif)
|
Posted: 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
|
|
|
|
|
![](images/spacer.gif) |
|