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.

Code Snippets / Color Square software sprites..

Author
Message
David Gervais
Retired Moderator
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 27th Dec 2005 22:45
Here is a little code snipet that draws 10 colored square images then pastes them at random on the screen to show how they look, this could be used for any color match type game where you need a different color square to place on screen etc..



Enjoy, and coments are always welcome.

Cheers!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 28th Dec 2005 12:15
Well, A tip might be:
DBPro can make gradient boxes.

box x, y, x2, y2, color1, color2, color3, color4

And each color represents the color of a corner. It can shorten you're code dramatically . If you have DBPro ofcourse...

Cheers!

Sven B
David Gervais
Retired Moderator
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 28th Dec 2005 21:59 Edited at: 28th Dec 2005 21:59
I do indeed have DBPro,.. but I'm just starting with it and have yet to learn all the commands.. I tend to look for commands as I need them while coding, then practice a few routines to test them out.

Thanks for pointing out that command, you're right of course, it would greatly shorten the codebase of the above sample.

Cheers!

Login to post a reply

Server time is: 2024-11-23 07:52:23
Your offset time is: 2024-11-23 07:52:23