|
Post by Alan on Jul 19, 2005 13:22:03 GMT -5
' setup
const width = 512 ' Must be a power of 2 const height = 256 ' Must be a power of 2 const border# = .1 dim height_32 height_32 = height / 32 dim a1#(height-1)(width-1) dim x, y, zoom_x#, zoom_y# dim view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy# glMatrixMode (GL_PROJECTION) glLoadIdentity () gluOrtho2D (0, 1, 0, 1) glMatrixMode (GL_MODELVIEW) dim tex tex = glGenTexture () glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glDisable (GL_DEPTH_TEST) const col_ground = 1, col_you# = .8, col_space = 0
' x, y, zoom_x#, view_x#, view_y#, width, height, col_ground, col_space
for x = (border# * width) to width - (border# * width) for y = height * .5 to height - (border# * height) a1#(y)(x) = col_ground next next for zoom_x# = 1 to 200 view_x# = (rnd()%(width - 20)) + 10 view_y# = (rnd()%(height_32 * 2)) + height_32 * 16 for x = -4 to 4 for y = -4 to 4 a1#(view_y# + y)(view_x# + x) = col_space next next next
' setup
view_x# = .5: view_y# = .495: zoom_x# = .3: zoom_y# = .4 dim amo(100), amo_x#(100), amo_y#(100), amo_fx#(100), amo_fy#(100) dim amo_c, amo_c2, amo_c3, amo_max, amo_size, amo_size_default, amo_size_next, amo_fired amo_size = 4: amo_size_default = 4: amo_size_next = amo_size_default: amo_max = 100 dim dead, dead2 const yousize_x# = 0.003, yousize_y# = 0.004 dim asp_x#, asp_y# asp_x# = 1.65: asp_y# = -1.25 dim weapon, sound(2) weapon = 1 sound(0) = loadsound("Sounds/laser.wav") sound(1) = loadsound("Sounds/gunshot5.wav") sound(2) = loadsound("Sounds/hello.wav") playsound(sound(2))
here:
' amo_c, amo_c2, amo_c3, amo, amo_x#, amo_y#, amo_fx#, amo_fy#, amo_fired, sound
if amo_c3 > 0 then amo_c3 = amo_c3 - 1 endif glcolor3f(.2, 0, 1) for amo_c = 1 to amo_max if amo(amo_c) = 0 then amo_x#(amo_c) = view_x#: amo_y#(amo_c) = view_y# if scankeydown(vk_down) and amo_c3 = 0 and dead = 0 then amo_c2 = amo_c2 + 1: amo_c3 = 20 if amo_c2 > amo_max then amo_c2 = 1 endif amo(amo_c) = 1: playsound(sound(0)) amo_fx#(amo_c) = view_fx# * 2 amo_fy#(amo_c) = -.001 endif endif if amo(amo_c) = 1 then if amo_y#(amo_c) < border# then amo_fy#(amo_c) = 0 endif if amo_y#(amo_c) > (1 - border#) then amo_fy#(amo_c) = -amo_fy#(amo_c) endif if amo_x#(amo_c) < border# or amo_x#(amo_c) > (1 - border#) then amo_fx#(amo_c) = -amo_fx#(amo_c) endif amo_x#(amo_c) = amo_x#(amo_c) + amo_fx#(amo_c) amo_y#(amo_c) = amo_y#(amo_c) + amo_fy#(amo_c) amo_fy#(amo_c) = amo_fy#(amo_c) + .00001 if a1#(amo_y#(amo_c) * height)(amo_x#(amo_c) * width) = 1 then playsound(sound(1)) amo(amo_c) = 0 for x = -m_pi * 20 to m_pi * 20 for y = -amo_size to amo_size if a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = .8 then dead = 1 endif a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = 0 next amo_fired = 1 next endif ' yousize_x#, yousize_y#, asp_x#, asp_y#, view_x#, view_y#
glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 1): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 0): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (0, 0): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glEnd () endif next ' none
SwapBuffers () waittimer(20) ' dead, weapon, amo_size, amo_size_default, amo_size_next, amo_fired
if dead = 0 then if amo_fired = 1 then amo_size = amo_size_next amo_fired = 0 endif if weapon > 0 then if keydown("a") or keydown("A") then amo_size = 20: amo_size_next = amo_size_default: weapon = 0 endif endif endif
' view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy#, width, height, dead, col_space, col_you#
if view_y# < border# or view_y# > (1 - border#) then dead = 1 endif if view_x# < border# or view_x# > (1 - border#) then dead = 1 endif a1#(view_oy# * height)(view_ox# * width) = col_space a1#(view_y# * height)(view_x# * width) = col_you# if dead = 0 then view_ox# = view_x# view_oy# = view_y# view_x# = view_x# + view_fx# view_y# = view_y# + view_fy# view_fx# = view_fx# * .99 view_fy# = view_fy# * .999 if scankeydown(vk_right) then view_fx# = view_fx# + .00001 endif if scankeydown(vk_left) then view_fx# = view_fx# - .00001 endif if a1#((view_y# * height) + 1)(view_x# * width) = 1 then view_fy# = 0 view_y# = view_y# - .0002 if scankeydown(vk_up) then view_fy# = -.002 endif else view_fy# = view_fy# + .00005 endif if a1#(view_y# * height)((view_x# * width) - 1) = 1 then if view_fx# < 0 then view_fx# = 0 endif view_x# = view_x# + .0002 endif if a1#(view_y# * height)((view_x# * width) + 1) = 1 then if view_fx# > 0 then view_fx# = 0 endif view_x# = view_x# - .0002 endif if a1#((view_y# * height) - 1)(view_x# * width) = 1 then view_y# = view_y# + .0002 view_fy# = 0 endif endif if dead = 1 and dead2 = 0 then zoom_x# = zoom_x# * 1.01 zoom_y# = zoom_y# * 1.01 asp_x# = asp_x# * .99 asp_y# = asp_y# * .99 amo_size = amo_size_default if zoom_x# > .4 then dead2 = 1 endif endif glClearColor (0, 0, 0, 0) glClear (GL_COLOR_BUFFER_BIT) glColor3f (1, 0, 0) glEnable (GL_TEXTURE_2D) glTexImage2D (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_FLOAT, a1#) glColor3f (1, 1, 1) glBegin (GL_QUADS) glTexCoord2f (view_x# - zoom_x#, view_y# + zoom_y#): glVertex2f (0, 0) glTexCoord2f (view_x# + zoom_x#, view_y# + zoom_y#): glVertex2f (1, 0) glTexCoord2f (view_x# + zoom_x#, view_y# - zoom_y#): glVertex2f (1, 1) glTexCoord2f (view_x# - zoom_x#, view_y# - zoom_y#): glVertex2f (0, 1) glEnd () gldisable (gl_texture_2d) glColor3f(0, .4, 0) glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (.5 - yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 1): glVertex2f (.5 + yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 0): glVertex2f (.5 + yousize_x#, .5 + yousize_y#) glTexCoord2f (0, 0): glVertex2f (.5 - yousize_x#, .5 + yousize_y#) glEnd () goto here: Cursor keys: Up = Jump Down = Fire Misile Left = Slide Left Right = Slide Right other keys: "a" = make next misile you fire a "super missile" (You only get one of these) Q: Why has the view stopped and zoomed out a bit A: You died (Eather by blowing yourself up or by leaving the battleground.) If you want to help me with development click here: basic4gl.proboards20.com/index.cgi?action=display&board=B4glhelp&thread=1121790650When it is in later stages of development it will be avalable on my website here www.with-logic.co.ukEscape to Quit
|
|
|
Post by Supermonkey on Jul 19, 2005 16:11:38 GMT -5
Good work, I wrote a worms clone once, I think the hardest part was terrain destruction and the physics so you have 1 out of 2 done .
|
|
|
Post by Fenryl on Jul 20, 2005 3:36:04 GMT -5
Nice! I liked it guess it was hard to make it... Go on with it!
|
|
|
Post by Alan on Jul 22, 2005 13:18:51 GMT -5
|
|
|
Post by scooby on Dec 12, 2005 7:03:14 GMT -5
Cool Game
|
|
|
Post by James :) (aka Madcow) on Apr 23, 2006 14:07:09 GMT -5
cool i'm making a camra that zomms that you control thats in the latest version but its having problems
|
|
|
Post by James :) (aka Madcow) on Apr 23, 2006 14:27:43 GMT -5
' setup
const width = 512 ' Must be a power of 2 const height = 256 ' Must be a power of 2 const border# = .1 dim height_32 height_32 = height / 32 dim a1#(height-1)(width-1) dim x, y, zoom_x#, zoom_y# dim view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy# glMatrixMode (GL_PROJECTION) glLoadIdentity () gluOrtho2D (0, 1, 0, 1) glMatrixMode (GL_MODELVIEW) dim tex tex = glGenTexture () glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glDisable (GL_DEPTH_TEST) const col_ground = 1, col_you# = .8, col_space = 0
' x, y, zoom_x#, view_x#, view_y#, width, height, col_ground, col_space
for x = (border# * width) to width - (border# * width) for y = height * .5 to height - (border# * height) a1#(y)(x) = col_ground next next for zoom_x# = 1 to 200 view_x# = (rnd()%(width - 20)) + 10 view_y# = (rnd()%(height_32 * 2)) + height_32 * 16 for x = -4 to 4 for y = -4 to 4 a1#(view_y# + y)(view_x# + x) = col_space next next next
' setup
view_x# = .5: view_y# = .495: zoom_x# = .3: zoom_y# = .4 dim amo(100), amo_x#(100), amo_y#(100), amo_fx#(100), amo_fy#(100) dim amo_c, amo_c2, amo_c3, amo_max, amo_size, amo_size_default, amo_size_next, amo_fired amo_size = 4: amo_size_default = 4: amo_size_next = amo_size_default: amo_max = 100 dim dead, dead2 const yousize_x# = 0.003, yousize_y# = 0.004 dim asp_x#, asp_y# asp_x# = 1.65: asp_y# = -1.25 dim weapon, sound(2) weapon = 1 sound(0) = loadsound("Sounds/laser.wav") sound(1) = loadsound("Sounds/gunshot5.wav") sound(2) = loadsound("Sounds/hello.wav") playsound(sound(2))
here:
' amo_c, amo_c2, amo_c3, amo, amo_x#, amo_y#, amo_fx#, amo_fy#, amo_fired, sound
if amo_c3 > 0 then amo_c3 = amo_c3 - 1 endif glcolor3f(.2, 0, 1) for amo_c = 1 to amo_max if amo(amo_c) = 0 then amo_x#(amo_c) = view_x#: amo_y#(amo_c) = view_y# if scankeydown(vk_down) and amo_c3 = 0 and dead = 0 then amo_c2 = amo_c2 + 1: amo_c3 = 20 if amo_c2 > amo_max then amo_c2 = 1 endif amo(amo_c) = 1: playsound(sound(0)) amo_fx#(amo_c) = view_fx# * 2 amo_fy#(amo_c) = -.001 endif endif if amo(amo_c) = 1 then if amo_y#(amo_c) < border# then amo_fy#(amo_c) = 0 endif if amo_y#(amo_c) > (1 - border#) then amo_fy#(amo_c) = -amo_fy#(amo_c) endif if amo_x#(amo_c) < border# or amo_x#(amo_c) > (1 - border#) then amo_fx#(amo_c) = -amo_fx#(amo_c) endif amo_x#(amo_c) = amo_x#(amo_c) + amo_fx#(amo_c) amo_y#(amo_c) = amo_y#(amo_c) + amo_fy#(amo_c) amo_fy#(amo_c) = amo_fy#(amo_c) + .00001 if a1#(amo_y#(amo_c) * height)(amo_x#(amo_c) * width) = 1 then playsound(sound(1)) amo(amo_c) = 0 for x = -m_pi * 20 to m_pi * 20 for y = -amo_size to amo_size if a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = .8 then dead = 1 endif a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = 0 next amo_fired = 1 next endif
' yousize_x#, yousize_y#, asp_x#, asp_y#, view_x#, view_y#
glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 1): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 0): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (0, 0): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glEnd () endif next
' none
SwapBuffers () waittimer(20)
' dead, weapon, amo_size, amo_size_default, amo_size_next, amo_fired
if dead = 0 then if amo_fired = 1 then amo_size = amo_size_next amo_fired = 0 endif if weapon > 0 then if keydown("a") or keydown("A") then amo_size = 20: amo_size_next = amo_size_default: weapon = 0 endif endif endif
' view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy#, width, height, dead, col_space, col_you#
if view_y# < border# or view_y# > (1 - border#) then dead = 1 endif if view_x# < border# or view_x# > (1 - border#) then dead = 1 endif a1#(view_oy# * height)(view_ox# * width) = col_space a1#(view_y# * height)(view_x# * width) = col_you# if dead = 0 then view_ox# = view_x# view_oy# = view_y# view_x# = view_x# + view_fx# view_y# = view_y# + view_fy# view_fx# = view_fx# * .99 view_fy# = view_fy# * .999 if scankeydown(vk_right) then view_fx# = view_fx# + .00001 endif if scankeydown(vk_left) then view_fx# = view_fx# - .00001 endif if a1#((view_y# * height) + 1)(view_x# * width) = 1 then view_fy# = 0 view_y# = view_y# - .0002 if scankeydown(vk_up) then view_fy# = -.002 endif else view_fy# = view_fy# + .00005 endif if a1#(view_y# * height)((view_x# * width) - 1) = 1 then if view_fx# < 0 then view_fx# = 0 endif view_x# = view_x# + .0002 endif if a1#(view_y# * height)((view_x# * width) + 1) = 1 then if view_fx# > 0 then view_fx# = 0 endif view_x# = view_x# - .0002 endif if a1#((view_y# * height) - 1)(view_x# * width) = 1 then view_y# = view_y# + .0002 view_fy# = 0 endif endif if dead = 1 and dead2 = 0 then amo_size = amo_size_default dead = 0 endif glClearColor (0, 0, 0, 0) glClear (GL_COLOR_BUFFER_BIT) glColor3f (1, 0, 0) glEnable (GL_TEXTURE_2D) glTexImage2D (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_FLOAT, a1#) glColor3f (1, 1, 1) glBegin (GL_QUADS) glTexCoord2f (view_x# - zoom_x#, view_y# + zoom_y#): glVertex2f (0, 0) glTexCoord2f (view_x# + zoom_x#, view_y# + zoom_y#): glVertex2f (1, 0) glTexCoord2f (view_x# + zoom_x#, view_y# - zoom_y#): glVertex2f (1, 1) glTexCoord2f (view_x# - zoom_x#, view_y# - zoom_y#): glVertex2f (0, 1) glEnd () gldisable (gl_texture_2d) glColor3f(0, .4, 0) glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (.5 - yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 1): glVertex2f (.5 + yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 0): glVertex2f (.5 + yousize_x#, .5 + yousize_y#) glTexCoord2f (0, 0): glVertex2f (.5 - yousize_x#, .5 + yousize_y#) glEnd () goto here:
unlimted lives with new super missile hack
|
|
|
Post by James :) (aka Madcow) on Apr 23, 2006 14:33:01 GMT -5
' setup
const width = 512 ' Must be a power of 2 const height = 256 ' Must be a power of 2 const border# = .1 dim height_32 height_32 = height / 32 dim a1#(height-1)(width-1) dim x, y, zoom_x#, zoom_y# dim view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy# glMatrixMode (GL_PROJECTION) glLoadIdentity () gluOrtho2D (0, 1, 0, 1) glMatrixMode (GL_MODELVIEW) dim tex tex = glGenTexture () glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glDisable (GL_DEPTH_TEST) const col_ground = 1, col_you# = .8, col_space = 0
' x, y, zoom_x#, view_x#, view_y#, width, height, col_ground, col_space
for x = (border# * width) to width - (border# * width) for y = height * .5 to height - (border# * height) a1#(y)(x) = col_ground next next for zoom_x# = 1 to 200 view_x# = (rnd()%(width - 20)) + 10 view_y# = (rnd()%(height_32 * 2)) + height_32 * 16 for x = -4 to 4 for y = -4 to 4 a1#(view_y# + y)(view_x# + x) = col_space next next next
' setup
view_x# = .5: view_y# = .495: zoom_x# = .3: zoom_y# = .4 dim amo(100), amo_x#(100), amo_y#(100), amo_fx#(100), amo_fy#(100) dim amo_c, amo_c2, amo_c3, amo_max, amo_size, amo_size_default, amo_size_next, amo_fired amo_size = 4: amo_size_default = 4: amo_size_next = amo_size_default: amo_max = 100 dim dead, dead2 const yousize_x# = 0.003, yousize_y# = 0.004 dim asp_x#, asp_y# asp_x# = 1.65: asp_y# = -1.25 dim weapon, sound(2) weapon = 1 sound(0) = loadsound("Sounds/laser.wav") sound(1) = loadsound("Sounds/gunshot5.wav") sound(2) = loadsound("Sounds/hello.wav") playsound(sound(2))
here:
' amo_c, amo_c2, amo_c3, amo, amo_x#, amo_y#, amo_fx#, amo_fy#, amo_fired, sound
if amo_c3 > 0 then amo_c3 = amo_c3 - 1 endif glcolor3f(.2, 0, 1) for amo_c = 1 to amo_max if amo(amo_c) = 0 then amo_x#(amo_c) = view_x#: amo_y#(amo_c) = view_y# if scankeydown(vk_down) and amo_c3 = 0 and dead = 0 then amo_c2 = amo_c2 + 1: amo_c3 = 20 if amo_c2 > amo_max then amo_c2 = 1 endif amo(amo_c) = 1: playsound(sound(0)) amo_fx#(amo_c) = view_fx# * 2 amo_fy#(amo_c) = -.001 endif endif if amo(amo_c) = 1 then if amo_y#(amo_c) < border# then amo_fy#(amo_c) = 0 endif if amo_y#(amo_c) > (1 - border#) then amo_fy#(amo_c) = -amo_fy#(amo_c) endif if amo_x#(amo_c) < border# or amo_x#(amo_c) > (1 - border#) then amo_fx#(amo_c) = -amo_fx#(amo_c) endif amo_x#(amo_c) = amo_x#(amo_c) + amo_fx#(amo_c) amo_y#(amo_c) = amo_y#(amo_c) + amo_fy#(amo_c) amo_fy#(amo_c) = amo_fy#(amo_c) + .00001 if a1#(amo_y#(amo_c) * height)(amo_x#(amo_c) * width) = 1 then playsound(sound(1)) amo(amo_c) = 0 for x = -m_pi * 20 to m_pi * 20 for y = -amo_size to amo_size if a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = .8 then dead = 1 endif a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = 0 next amo_fired = 1 next endif
' yousize_x#, yousize_y#, asp_x#, asp_y#, view_x#, view_y#
glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 1): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 0): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (0, 0): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glEnd () endif next
' none
SwapBuffers () waittimer(20)
' dead, weapon, amo_size, amo_size_default, amo_size_next, amo_fired
if dead = 0 then if amo_fired = 1 then amo_size = amo_size_next amo_fired = 0 endif if weapon > 0 then if keydown("a") or keydown("A") then amo_size = 20: amo_size_next = amo_size_default endif endif endif
' view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy#, width, height, dead, col_space, col_you#
if view_y# < border# or view_y# > (1 - border#) then dead = 1 endif if view_x# < border# or view_x# > (1 - border#) then dead = 1 endif a1#(view_oy# * height)(view_ox# * width) = col_space a1#(view_y# * height)(view_x# * width) = col_you# if dead = 0 then view_ox# = view_x# view_oy# = view_y# view_x# = view_x# + view_fx# view_y# = view_y# + view_fy# view_fx# = view_fx# * .99 view_fy# = view_fy# * .999 if scankeydown(vk_right) then view_fx# = view_fx# + .00001 endif if scankeydown(vk_left) then view_fx# = view_fx# - .00001 endif if a1#((view_y# * height) + 1)(view_x# * width) = 1 then view_fy# = 0 view_y# = view_y# - .0002 if scankeydown(vk_up) then view_fy# = -.002 endif else view_fy# = view_fy# + .00005 endif if a1#(view_y# * height)((view_x# * width) - 1) = 1 then if view_fx# < 0 then view_fx# = 0 endif view_x# = view_x# + .0002 endif if a1#(view_y# * height)((view_x# * width) + 1) = 1 then if view_fx# > 0 then view_fx# = 0 endif view_x# = view_x# - .0002 endif if a1#((view_y# * height) - 1)(view_x# * width) = 1 then view_y# = view_y# + .0002 view_fy# = 0 endif endif if dead = 1 and dead2 = 0 then dead=0 amo_size = amo_size_default endif glClearColor (0, 0, 0, 0) glClear (GL_COLOR_BUFFER_BIT) glColor3f (1, 0, 0) glEnable (GL_TEXTURE_2D) glTexImage2D (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_FLOAT, a1#) glColor3f (1, 1, 1) glBegin (GL_QUADS) glTexCoord2f (view_x# - zoom_x#, view_y# + zoom_y#): glVertex2f (0, 0) glTexCoord2f (view_x# + zoom_x#, view_y# + zoom_y#): glVertex2f (1, 0) glTexCoord2f (view_x# + zoom_x#, view_y# - zoom_y#): glVertex2f (1, 1) glTexCoord2f (view_x# - zoom_x#, view_y# - zoom_y#): glVertex2f (0, 1) glEnd () gldisable (gl_texture_2d) glColor3f(0, .4, 0) glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (.5 - yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 1): glVertex2f (.5 + yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 0): glVertex2f (.5 + yousize_x#, .5 + yousize_y#) glTexCoord2f (0, 0): glVertex2f (.5 - yousize_x#, .5 + yousize_y#) glEnd () goto here:
new unlimited lives and superbombs
|
|
|
Post by James :) (aka Madcow) on Apr 23, 2006 14:40:36 GMT -5
walk though walls can jump as well fixed stuck bug but will crash when falling past iland no limit onlives or super wepon
' setup
const width = 512 ' Must be a power of 2 const height = 256 ' Must be a power of 2 const border# = .1 dim height_32 height_32 = height / 32 dim a1#(height-1)(width-1) dim x, y, zoom_x#, zoom_y# dim view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy# glMatrixMode (GL_PROJECTION) glLoadIdentity () gluOrtho2D (0, 1, 0, 1) glMatrixMode (GL_MODELVIEW) dim tex tex = glGenTexture () glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glDisable (GL_DEPTH_TEST) const col_ground = 1, col_you# = .8, col_space = 0
' x, y, zoom_x#, view_x#, view_y#, width, height, col_ground, col_space
for x = (border# * width) to width - (border# * width) for y = height * .5 to height - (border# * height) a1#(y)(x) = col_ground next next for zoom_x# = 1 to 200 view_x# = (rnd()%(width - 20)) + 10 view_y# = (rnd()%(height_32 * 2)) + height_32 * 16 for x = -4 to 4 for y = -4 to 4 a1#(view_y# + y)(view_x# + x) = col_space next next next
' setup
view_x# = .5: view_y# = .495: zoom_x# = .3: zoom_y# = .4 dim amo(100), amo_x#(100), amo_y#(100), amo_fx#(100), amo_fy#(100) dim amo_c, amo_c2, amo_c3, amo_max, amo_size, amo_size_default, amo_size_next, amo_fired amo_size = 4: amo_size_default = 4: amo_size_next = amo_size_default: amo_max = 100 dim dead, dead2 const yousize_x# = 0.003, yousize_y# = 0.004 dim asp_x#, asp_y# asp_x# = 1.65: asp_y# = -1.25 dim weapon, sound(2) weapon = 1 sound(0) = loadsound("Sounds/laser.wav") sound(1) = loadsound("Sounds/gunshot5.wav") sound(2) = loadsound("Sounds/hello.wav") playsound(sound(2))
here:
' amo_c, amo_c2, amo_c3, amo, amo_x#, amo_y#, amo_fx#, amo_fy#, amo_fired, sound
if amo_c3 > 0 then amo_c3 = amo_c3 - 1 endif glcolor3f(.2, 0, 1) for amo_c = 1 to amo_max if amo(amo_c) = 0 then amo_x#(amo_c) = view_x#: amo_y#(amo_c) = view_y# if scankeydown(vk_down) and amo_c3 = 0 and dead = 0 then amo_c2 = amo_c2 + 1: amo_c3 = 20 if amo_c2 > amo_max then amo_c2 = 1 endif amo(amo_c) = 1: playsound(sound(0)) amo_fx#(amo_c) = view_fx# * 2 amo_fy#(amo_c) = -.001 endif endif if amo(amo_c) = 1 then if amo_y#(amo_c) < border# then amo_fy#(amo_c) = 0 endif if amo_y#(amo_c) > (1 - border#) then amo_fy#(amo_c) = -amo_fy#(amo_c) endif if amo_x#(amo_c) < border# or amo_x#(amo_c) > (1 - border#) then amo_fx#(amo_c) = -amo_fx#(amo_c) endif amo_x#(amo_c) = amo_x#(amo_c) + amo_fx#(amo_c) amo_y#(amo_c) = amo_y#(amo_c) + amo_fy#(amo_c) amo_fy#(amo_c) = amo_fy#(amo_c) + .00001 if a1#(amo_y#(amo_c) * height)(amo_x#(amo_c) * width) = 1 then playsound(sound(1)) amo(amo_c) = 0 for x = -m_pi * 20 to m_pi * 20 for y = -amo_size to amo_size if a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = .8 then dead = 1 endif a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = 0 next amo_fired = 1 next endif
' yousize_x#, yousize_y#, asp_x#, asp_y#, view_x#, view_y#
glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 1): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 0): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (0, 0): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glEnd () endif next
' none
SwapBuffers () waittimer(20)
' dead, weapon, amo_size, amo_size_default, amo_size_next, amo_fired
if dead = 0 then if amo_fired = 1 then amo_size = amo_size_next amo_fired = 0 endif if weapon > 0 then if keydown("a") or keydown("A") then amo_size = 20: amo_size_next = amo_size_default endif endif endif
' view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy#, width, height, dead, col_space, col_you#
if view_y# < border# or view_y# > (1 - border#) then dead = 0 endif if view_x# < border# or view_x# > (1 - border#) then view_x# = view_x# endif a1#(view_oy# * height)(view_ox# * width) = col_space a1#(view_y# * height)(view_x# * width) = col_you# if dead = 0 then view_ox# = view_x# view_oy# = view_y# view_x# = view_x# + view_fx# view_y# = view_y# + view_fy# view_fx# = view_fx# * .99 view_fy# = view_fy# * .999 if scankeydown(vk_right) then view_fx# = view_fx# + .00001 endif if scankeydown(vk_left) then view_fx# = view_fx# - .00001 endif if a1#((view_y# * height) + 1)(view_x# * width) = 1 then view_fy# = 0 view_y# = view_y# - .0002 if scankeydown(vk_up) then view_fy# = -.002 endif else view_fy# = view_fy# + .00005 endif if a1#(view_y# * height)((view_x# * width) - 1) = 1 then if a1#(view_y# * height)((view_x# * width) + 1) = 1 then if a1#((view_y# * height) - 1)(view_x# * width) = 1 then view_y# = view_y# + .0002 view_fy# = 0 endif endif endif endif if dead = 1 and dead2 = 0 then dead=0 amo_size = amo_size_default endif glClearColor (0, 0, 0, 0) glClear (GL_COLOR_BUFFER_BIT) glColor3f (1, 0, 0) glEnable (GL_TEXTURE_2D) glTexImage2D (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_FLOAT, a1#) glColor3f (1, 1, 1) glBegin (GL_QUADS) glTexCoord2f (view_x# - zoom_x#, view_y# + zoom_y#): glVertex2f (0, 0) glTexCoord2f (view_x# + zoom_x#, view_y# + zoom_y#): glVertex2f (1, 0) glTexCoord2f (view_x# + zoom_x#, view_y# - zoom_y#): glVertex2f (1, 1) glTexCoord2f (view_x# - zoom_x#, view_y# - zoom_y#): glVertex2f (0, 1) glEnd () gldisable (gl_texture_2d) glColor3f(0, .4, 0) glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (.5 - yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 1): glVertex2f (.5 + yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 0): glVertex2f (.5 + yousize_x#, .5 + yousize_y#) glTexCoord2f (0, 0): glVertex2f (.5 - yousize_x#, .5 + yousize_y#) glEnd () goto here:
|
|
|
Post by James :) (aka Madcow) on Apr 23, 2006 14:45:24 GMT -5
every thing else but very fast shooting
' setup
const width = 512 ' Must be a power of 2 const height = 256 ' Must be a power of 2 const border# = .1 dim height_32 height_32 = height / 32 dim a1#(height-1)(width-1) dim x, y, zoom_x#, zoom_y# dim view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy# glMatrixMode (GL_PROJECTION) glLoadIdentity () gluOrtho2D (0, 1, 0, 1) glMatrixMode (GL_MODELVIEW) dim tex tex = glGenTexture () glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glDisable (GL_DEPTH_TEST) const col_ground = 1, col_you# = .8, col_space = 0
' x, y, zoom_x#, view_x#, view_y#, width, height, col_ground, col_space
for x = (border# * width) to width - (border# * width) for y = height * .5 to height - (border# * height) a1#(y)(x) = col_ground next next for zoom_x# = 1 to 200 view_x# = (rnd()%(width - 20)) + 10 view_y# = (rnd()%(height_32 * 2)) + height_32 * 16 for x = -4 to 4 for y = -4 to 4 a1#(view_y# + y)(view_x# + x) = col_space next next next
' setup
view_x# = .5: view_y# = .495: zoom_x# = .3: zoom_y# = .4 dim amo(100), amo_x#(100), amo_y#(100), amo_fx#(100), amo_fy#(100) dim amo_c, amo_c2, amo_c3, amo_max, amo_size, amo_size_default, amo_size_next, amo_fired amo_size = 4: amo_size_default = 4: amo_size_next = amo_size_default: amo_max = 100 dim dead, dead2 const yousize_x# = 0.003, yousize_y# = 0.004 dim asp_x#, asp_y# asp_x# = 1.65: asp_y# = -1.25 dim weapon, sound(2) weapon = 1 sound(0) = loadsound("Sounds/laser.wav") sound(1) = loadsound("Sounds/gunshot5.wav") sound(2) = loadsound("Sounds/hello.wav") playsound(sound(2))
here:
' amo_c, amo_c2, amo_c3, amo, amo_x#, amo_y#, amo_fx#, amo_fy#, amo_fired, sound
if amo_c3 > 0 then amo_c3 = amo_c3 - 1 endif glcolor3f(.2, 0, 1) for amo_c = 1 to amo_max if amo(amo_c) = 0 then amo_x#(amo_c) = view_x#: amo_y#(amo_c) = view_y# if scankeydown(vk_down) and amo_c3 = 0 and dead = 0 then amo_c2 = amo_c2 + 1: amo_c3 = 0 if amo_c2 > amo_max then amo_c2 = 1 endif amo(amo_c) = 1: playsound(sound(0)) amo_fx#(amo_c) = view_fx# * 2 amo_fy#(amo_c) = -.001 endif endif if amo(amo_c) = 1 then if amo_y#(amo_c) < border# then amo_fy#(amo_c) = 0 endif if amo_y#(amo_c) > (1 - border#) then amo_fy#(amo_c) = -amo_fy#(amo_c) endif if amo_x#(amo_c) < border# or amo_x#(amo_c) > (1 - border#) then amo_fx#(amo_c) = -amo_fx#(amo_c) endif amo_x#(amo_c) = amo_x#(amo_c) + amo_fx#(amo_c) amo_y#(amo_c) = amo_y#(amo_c) + amo_fy#(amo_c) amo_fy#(amo_c) = amo_fy#(amo_c) + .00001 if a1#(amo_y#(amo_c) * height)(amo_x#(amo_c) * width) = 1 then playsound(sound(1)) amo(amo_c) = 0 for x = -m_pi * 20 to m_pi * 20 for y = -amo_size to amo_size if a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = .8 then dead = 1 endif a1#((amo_y#(amo_c) * height) + (sin((x * .025)) * y))((amo_x#(amo_c) * width) + (cos((x * .025)) * y)) = 0 next amo_fired = 1 next endif
' yousize_x#, yousize_y#, asp_x#, asp_y#, view_x#, view_y#
glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 1): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, -yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (1, 0): glVertex2f ( yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glTexCoord2f (0, 0): glVertex2f (-yousize_x# + ((amo_x#(amo_c) * asp_x#) - (view_x#*asp_x#)) + .5, yousize_y# + ((amo_y#(amo_c) * asp_y#) - (view_y# * asp_y#)) + .5) glEnd () endif next
' none
SwapBuffers () waittimer(20)
' dead, weapon, amo_size, amo_size_default, amo_size_next, amo_fired
if dead = 0 then if amo_fired = 1 then amo_size = amo_size_next amo_fired = 0 endif if weapon > 0 then if keydown("a") or keydown("A") then amo_size = 20: amo_size_next = amo_size_default endif endif endif
' view_x#, view_y#, view_ox#, view_oy#, view_fx#, view_fy#, width, height, dead, col_space, col_you#
if view_y# < border# or view_y# > (1 - border#) then dead = 0 endif if view_x# < border# or view_x# > (1 - border#) then view_x# = view_x# endif a1#(view_oy# * height)(view_ox# * width) = col_space a1#(view_y# * height)(view_x# * width) = col_you# if dead = 0 then view_ox# = view_x# view_oy# = view_y# view_x# = view_x# + view_fx# view_y# = view_y# + view_fy# view_fx# = view_fx# * .99 view_fy# = view_fy# * .999 if scankeydown(vk_right) then view_fx# = view_fx# + .00001 endif if scankeydown(vk_left) then view_fx# = view_fx# - .00001 endif if a1#((view_y# * height) + 1)(view_x# * width) = 1 then view_fy# = 0 view_y# = view_y# - .0002 if scankeydown(vk_up) then view_fy# = -.002 endif else view_fy# = view_fy# + .00005 endif if a1#(view_y# * height)((view_x# * width) - 1) = 1 then if a1#(view_y# * height)((view_x# * width) + 1) = 1 then if a1#((view_y# * height) - 1)(view_x# * width) = 1 then view_y# = view_y# + .0002 view_fy# = 0 endif endif endif endif if dead = 1 and dead2 = 0 then dead=0 amo_size = amo_size_default endif glClearColor (0, 0, 0, 0) glClear (GL_COLOR_BUFFER_BIT) glColor3f (1, 0, 0) glEnable (GL_TEXTURE_2D) glTexImage2D (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_FLOAT, a1#) glColor3f (1, 1, 1) glBegin (GL_QUADS) glTexCoord2f (view_x# - zoom_x#, view_y# + zoom_y#): glVertex2f (0, 0) glTexCoord2f (view_x# + zoom_x#, view_y# + zoom_y#): glVertex2f (1, 0) glTexCoord2f (view_x# + zoom_x#, view_y# - zoom_y#): glVertex2f (1, 1) glTexCoord2f (view_x# - zoom_x#, view_y# - zoom_y#): glVertex2f (0, 1) glEnd () gldisable (gl_texture_2d) glColor3f(0, .4, 0) glBegin (GL_QUADS) glTexCoord2f (0, 1): glVertex2f (.5 - yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 1): glVertex2f (.5 + yousize_x#, .5 - yousize_y#) glTexCoord2f (1, 0): glVertex2f (.5 + yousize_x#, .5 + yousize_y#) glTexCoord2f (0, 0): glVertex2f (.5 - yousize_x#, .5 + yousize_y#) glEnd () goto here:
|
|