`// Raven - Simple Scene using Vectors
`// 01-06-2003
`// LB-DBS for Ripple Script (couldn't be arsed to make my own and i liked the effect)
hide mouse
backdrop on
autocam off
`------------------------------
` types & globals
`------------------------------
type vector3_t
x as float
y as float
z as float
endtype
type camera_t
ang as vector3_t
vec as dword
z as float
endtype
type object_t
ang as vector3_t
vec as dword
endtype
global g_pVector3 as dword
global cube as dword
global matrixsize as dword
global rad as float
`// global definitions
cube = 1
matrix = 100
rad = 40.0
`//--------------------------------------------
`// Setup program arrays & object values
`//--------------------------------------------
dim cam(1) as camera_t
make camera 1
cam(1).vec=(g_pVector3=g_pVector3+1)
NULL_RETURN = make vector3( cam(1).vec )
set vector3 cam(1).vec, camera position x(1), camera position y(1), camera position z(1)
cam(1).ang.x = camera angle x(1)
cam(1).ang.z = camera angle z(1)
cam(1).ang.y = 180.0
set current camera 1
dim object(1) as object_t
object(1).vec=(g_pVector3=g_pVector3+1)
NULL_RETURN = make vector3( object(cube).vec )
`//--------------------------------------------
`// create game media
`//--------------------------------------------
make object cube cube, 10.0
`make matrix 1, (matrixsize*1.0), (matrixsize*1.0), (matrixsize/10), (matrixsize/10) // another function seemingly not working ... and i'm not sure why!!
`position matrix 1, matrixsize-( matrixsize*1.5 ), 0.0, matrixsize-( matrixsize*1.5 )
`update matrix 1
`i as integer
`dim ripple( (matrixsize-1)* matrixsize )
`for i=0 to (matrixsize*matrixsize)
` ripple(i)=rnd(50)
`next i
gosub _camera :`// init camera's original position & rotation
do
if escapekey()=1 then exit
`wave( 1, (matrixsize/10), (matrixsize/10) )
cam(1).z=mousemovez()
if mouseclick()=1
goto _camera
endif
position camera 1, ( object(cube).vec + cam(1).vec )
move camera 1, cam(1).z
loop
release()
end
`//--------------------------------------------
`// name: _camera
`// desc: is called each time you need the camera updated
`// -------------------------------------------
_camera:
cam(1).ang.x = wrapvalue( cam(1).ang.x + ( mousemovex()/2 ) )
cam(1).ang.z = wrapvalue( cam(1).ang.z + ( mousemovex()/2 ) )
cam(1).ang.y = wrapvalue( cam(1).ang.y + ( mousemovey()/2 ) )
set vector3 cam(1).vec,(sin( cam(1).ang.y ) ),( ( cos( cam(1).ang.x ) * rad ) * cos( cam(1).ang.y ) ),( ( cos( cam(1).ang.z ) * rad ) * cos( cam(1).ang.y ) )
rotate camera 1,wrapvalue( ( cam(1).ang.y * -1.0 ) + 180.0 ),wrapvalue( ( cam(1).ang.x * -1.0 ) ) + 90.0, 0.0
return
remstart
`/*
`//--------------------------------------------
`// name: wave( matrix, tile count x, tile count y )
`// desc: updates simple matrix wave
`// -------------------------------------------
function wave( matrix as integer, mx as integer, my as integer )
`{
local height as float
local index as integer
for x=1 to (mx-1)
for y=1 to (my-1)
height=get matrix height( matrix, x,y )
index=x+( y*5 )
set matrix height matrix, x,y, height+( cos( ripple(index) )*0.1 )
ripple(index)=wrapvalue( ripple(index)+1 )
next y
next x
update matrix matrix
endfunction
`} void
`*/
remend
`//--------------------------------------------
`// name: release()
`// desc: releases all memory resident instances
`// -------------------------------------------
function release()
`{
NULL_RETURN=delete vector3( cam(1).vec )
NULL_RETURN=delete vector3( object(cube).vec )
`undim ripple(0)
undim cam(0)
`delete matrix 1
delete object cube
endfunction
`} void
i'm not sure what to do with this bloody code, it makes little to no sense why it doesn't work

the matrix not working now thats just a bloody mystery on its own

so i'm leaving it in the capable hands of you guys to see if you can fixx whatever the hell is actually wrong
Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!