Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / sprites and color swapping...

Author
Message
flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 9th Jan 2008 21:04
Hey. In my current proyecto, i am using a good chunk `o sprites. Its n action arcade kind of game, and i want to be able to swap between a bunch of different kinds of color modes pretty fast, and mantain a good framerate. So far, i have found ways of doing an inverted color scheme and a greyscale scheme, and im looking for a couple other ones, maybe spohia?
Anyway, so at the moment, im planting a code in a lot of different parts of the source to turn enemies/bullets/backgroud/text/player and other stuff different colors.
the code looks similar to this...

HOWEVER, this is all good and well, but i want to know if there is a quicker way of doing this? I was thinking that you could modify everypixel on the screen with memblocks, but i have absoululy NO idea how to use those... So guess what this comes down to is a request for help in the memblocks department.


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 11th Jan 2008 03:50
anyone?


This is my WIP, not even ready for a WIP thread yet though.http://smallgroupproductions.com/
Mr Kohlenstoff
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 11th Jan 2008 23:17
Why do you need a quicker way? Is this method actually slow? I can't really believe that, because commands like "set sprite diffuse" are nearly as fast as simple variable-changes in general, as far as I know. I would, however, probably use different sprites for each type of color. It would require a bit more RAM (and if you don't create the different versions on the run also more disk-space) but should be very fast and stable.
Manipulating every pixel of the screen could be a possibility, if you don't use get image because it's much to slow, but you'd need a very intelligent algorithm to recognize which color has to be changed and how... also you had to use 3D cameras because that is the only method I know to store the screen in an image with acceptable speed. (Or is it possible to use bitmaps to achieve this effect? I never worked with the bitmap-commands)
Or maybe I just did not understand the problem.

flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 14th Jan 2008 06:11
i suppose u r right. thx


This is my WIP, not even ready for a WIP thread yet though.http://smallgroupproductions.com/

Login to post a reply

Server time is: 2024-05-17 09:48:10
Your offset time is: 2024-05-17 09:48:10