Slick Forums

Discuss the Slick 2D Library
It is currently Sat Dec 16, 2017 2:49 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Pixel manipulation tests
PostPosted: Thu Mar 07, 2013 1:57 am 
Offline

Joined: Wed Jan 02, 2013 3:21 pm
Posts: 7
One night as I was falling asleep I got an interesting concept to design a game around. I thought it would be neat to have a game where anytime a sprite gets hit, their pixels that get hit fly off of them. The next day I read up a bit more on slick2d's API and began doing tests. I came up with these samples over the next few days:

Sample 1:
Download Here:http://www.mediafire.com/?w33mlv5rk6kup7d
Click anywhere on the screen to cause the image to deconstruct and then reassemble where your mouse is.


Sample 2:
Download Here:http://www.mediafire.com/?0of0v8958ivbmf6
Right-Click to add new sprites to the screen and mouse over them cause their pixels to scatter and then reassemble. You can also left-click to dissamble/reassemble just like the first test, but it's much buggier in this one: a) If you click while some particles are still moving, only the non-moving ones will relocate. b) If you move your mouse while clicking, pixels won't go right to your mouse anymore. c) If there is more than one sprite on screen, they will all just stack on top of one another.


Sample 3:
Download Here:http://www.mediafire.com/?15ksmei7ezrw5eo
This is getting closer to my original idea I had in my head. Right-click to add new sprites to the screen and left-click to fire bullets. If you mouse over a sprite or shoot a bullet at them, they will scatter/reassemble much like in Sample 2. However, in this one they will get lighter in color every time they get hit. Eventually they will just disappear after being hit enough. If a certain percentage of the pixels of a sprite have been destroyed (I don't recall the number off the top of my head), the rest of the sprite will scatter and vanish.

Anyways thanks for checking this out, and feedback is always nice.


Top
 Profile  
 
PostPosted: Thu Mar 07, 2013 11:45 am 
Offline
Regular

Joined: Sun Oct 25, 2009 5:24 pm
Posts: 118
Haha this is awesome :mrgreen:


Top
 Profile  
 
PostPosted: Fri Mar 08, 2013 4:48 pm 
Offline

Joined: Fri Mar 08, 2013 4:44 pm
Posts: 1
Impressive! Would you be so kind to post the source? At least for the first one? :wink:

Cheers!


Top
 Profile  
 
PostPosted: Sun Mar 10, 2013 2:31 am 
Offline

Joined: Wed Jan 02, 2013 3:21 pm
Posts: 7
Here you go, the source code for the first sample: http://www.mediafire.com/?fxxa7zd96az3fjy

Keep in mind the code for this one in particular is VERY sloppy. That said, it gets the job done and hopefully you'll figure it out. Glad to hear you liked it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group