cool turbine triangle gradient!

Talk about making games.

cool turbine triangle gradient!

Postby Game A Gogo » Tue Nov 21, 2006 12:54 am

hey yalll!
ive come up whit a cool code that makes a cool gradient!

1. create a canvas actor named me canvas.
2. make it the same size as the view,
3 on create actor, add this code:
Code: Select all
int Count;
for(Count=0; Count<height*4; Count+=4)
{
setpen(Count/4, Count/2, Count/3, 0, 5);
moveto(0, Count/4);
lineto(width, Count);
}

and its done!

change the division where the color inside and it makes other color.

NOTE:
this was tested and aproved on a 640x480 screen resolution, it dosnt give the same result on a smaller screen and there is too much white when bigger.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Zehper48 » Wed Nov 22, 2006 3:31 pm

W0W that looks awesome
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby Game A Gogo » Wed Nov 22, 2006 11:24 pm

thx
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Oman » Sat Nov 25, 2006 12:20 am

that is cool 8)

wat if i wanted to make it more like sky,
like more blue and less dark at the top
wat do i need to change to change colors
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Game A Gogo » Tue Nov 28, 2006 12:30 am

well then
it needs another code
like ummm.
THIS ONE:
Code: Select all
int Count;
for(Count=height*4; Count>0; Count-=4)
{
setpen(Count/4, Count/3, Count/2, 0, 5);
moveto(0, Count/4);
lineto(width, Count);
}

not sure if it will work, just maded some quick changes.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby DilloDude » Tue Nov 28, 2006 9:21 am

The big question is: is using code to do a nice background better, or is using an image file (like a printscreen of the code) more efficient. With drawing it, it only has to draw once, and with an image is loads once. Assuming that maintaining the image is the same for an animation as a canvas (which isn't necesarily so) the difference will be mostly in the file size: the draw version needs to store the extra code used to generate the image, whereas the image version needs to store the compressed image file. Which is better?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Oman » Tue Nov 28, 2006 1:19 pm

That looks awsome :D

Can you give me the code (if you know it)
to turn that image upsidedown. So that the
black would be at the bottom and the white at
the top.That would be even cooler :D :D :D
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Game A Gogo » Wed Nov 29, 2006 12:10 am

DilloDude wrote:The big question is: is using code to do a nice background better, or is using an image file (like a print screen of the code) more efficient. With drawing it, it only has to draw once, and with an image is loads once. Assuming that maintaining the image is the same for an animation as a canvas (which isn't necessarily so) the difference will be mostly in the file size: the draw version needs to store the extra code used to generate the image, whereas the image version needs to store the compressed image file. Which is better?

yes, but whit canvas, you have more flexibility, and i was just tuning up my knowledge for drawing whit canvas.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby DilloDude » Wed Nov 29, 2006 8:22 am

Yes, canvases are good for fiddling around with things. But if images are more efficient, you can still use canvas - just fiddle with them in a separate game file, then run it and use printscreen to get the actual result.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Game A Gogo » Wed Nov 29, 2006 10:43 pm

sure is true!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest