Post by 8XenoTrogdor8 on Oct 13, 2004 21:43:17 GMT -5
I made this code for 2 reasons.
1--So I could figure out how to use the for and next loops.
2--So I could show off to all of you.
3--Because a girl at school said it would be really cool to make something like this.
There are my 3 reasons, and here is the code.
Well, maybe its not that impressive. But I thought it was pretty cool! Originally I used a white circle texture in it, but the star texture that comes with basic4gl would look sweet too! Now the only question is what to do with this program... I know! modify the colors and use it as a wormhole in a space adventure game! Brilliant!
Anyway, anyone who wants can modify it in any way, it doesn't matter to me. And any feedback about ways I could have made it better or stuff like that would also be appreciated.
Later all y'all!
1--So I could figure out how to use the for and next loops.
2--So I could show off to all of you.
3--Because a girl at school said it would be really cool to make something like this.
There are my 3 reasons, and here is the code.
Dim rotate#, vertex#(4), color#(4), i
vertex#(1) = 1
vertex#(2) = 2
vertex#(3) = 3
vertex#(4) = 4
glBlendFunc (GL_SRC_ALPHA, GL_ONE)
glEnable (GL_BLEND)
while true
glLoadIdentity ()
gltranslatef (0, 0, -200)
for i = 1 to 4
glrotatef (rotate#, 0, 0, 1)
glBegin (GL_QUADS)
glcolor4f (color#(1), color#(2), color#(3), color#(4))
glVertex2f (vertex#(i), vertex#(i))
glVertex2f (vertex#(i) + 5, vertex#(i))
glVertex2f (vertex#(i) + 5, vertex#(i) + 5)
glVertex2f (vertex#(i), vertex#(i) + 5)
glEnd ()
if i = 1 then color#(1) = 0 : color#(2) = 1 : color#(3) = 0 : color#(4) = .5
else if i = 2 then color#(1) = 0 : color#(2) = 0 : color#(3) = 1 : color#(4) = .5
else if i = 3 then color#(1) = 1 : color#(2) = 0 : color#(3) = 0 : color#(4) = .5
else if i = 4 then color#(1) = .2: color#(2) = .5: color#(3) = .2: color#(4) = .5
endif : endif : endif : endif
vertex#(i) = vertex#(i) + .1
next
rotate# = rotate# + 1
sleep (50)
SwapBuffers ()
wend
Well, maybe its not that impressive. But I thought it was pretty cool! Originally I used a white circle texture in it, but the star texture that comes with basic4gl would look sweet too! Now the only question is what to do with this program... I know! modify the colors and use it as a wormhole in a space adventure game! Brilliant!
Anyway, anyone who wants can modify it in any way, it doesn't matter to me. And any feedback about ways I could have made it better or stuff like that would also be appreciated.
Later all y'all!