TGC Codebase Backup



Warp Tunnel by Richard Davey

29th Aug 2003 23:29
Summary

A nice and simple effect that simulates flying down a warp tunnel, rotating and zooming. Two textures provided one that simulates lava bubbles and one that looks like a starburst



Description

==========================================================
A Screaming Product Of The DARKFORGE (www.darkforge.co.uk)
==========================================================

Title

Warp Tunnel

Version

1.0

Date

March 31st 2000

Files

warp_tunnel.dba 1568 Bytes
plasma.bmp 49208 Bytes
lava.bmp 49208 Bytes
rom.mid 3834 Bytes
warp_tunnel.jpg 10397 Bytes

Programmer

Richard Davey
rich@fatal-design.com

DB Version

DarkBasic v1.02 (Registered)

License

Public Domain

Comments

A nice and simple effect that simulates flying down a
warp tunnel, rotating and zooming. Two textures provided
one that simulates lava bubbles and one that looks like a
starburst. Cool midi by Oedipus.

==========================================================
(c) www.darkforge.co.uk 2000
==========================================================



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
`              Warp Tunnel
` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
` By Rich Davey (rich@fatal-design.com)
` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
` Fly and spin down a warp tunnel! Easy
` effect  but  looks  really  effective 
` with a good texture.
`
` Music listened  to while  coding this
` The Beach soundtrack.
` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

sync rate 60
sync on
hide mouse

`	128x128 texture
`	Change to "lava.bmp" for a different effect

load image "plasma.bmp",1

`	Music

load music "rom.mid",1

`	Create 2 copies of this texture as bitmap 1 then grab it to image 2

create bitmap 1,128,256
set current bitmap 1
paste image 1,0,0
paste image 1,0,128

`	Set drawing back to the screen

set current bitmap 0
create bitmap 2,128,128

`	Lets make our tunnel

make object cylinder 1,100
rotate object 1,270,0,270
fix object pivot 1
scale object 1,100,100,2500
texture object 1,1
set object 1,1,0,0

`	Hide the end of the cylinder

make object sphere 2,100
color object 2,rgb(0,0,0)
position object 2,0,0,1000

color backdrop rgb(0,0,0)

position camera 0,0,-1250

`	Change to alter speed of zoom

speed=1; limit=1; counter=0
play music 1

`	Main Loop

do

	if counter=limit
		set current bitmap 1
		get image 2,0,y,128,y+128
		set current bitmap 2
		paste image 2,0,0
		set current bitmap 0
		texture object 1,2
		inc y
		if y=128 then y=0
		counter=0
	endif

	z=z+speed; zrotate camera wrapvalue(z)
	inc counter

	sync
	
loop