Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / This makes me sick..

Author
Message
Lampton Worm
15
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 27th Nov 2002 00:53
Newbies! Fancy trying a sea game ? Well.. just zooming about in this makes me reach for the sea legs. Its just a combination of the matrix height snippet/matrix water demo, thats all..


sync on:sync rate 100:hide mouse:set display mode 800,600,16
ink rgb(20,20,200),rgb(0,0,0):box 0,0,39,39:get image 1,0,0,40,40
make matrix 1,600,600,36,36:prepare matrix texture 1,1,1,1:update matrix 1
make object cube 100,10:px#=150:py#=50:pz#=50
do
position object 100,px#,py#,pz#
if upkey()=1 then move object 100,0.5
if downkey()=1 then move object 100,0-0.5
px#=object position x(100)
py#=get ground height(1,object position x(100),object position z(100))
pz#=object position z(100)
cy#=wrapvalue(cy#+mousemovex()*0.3)
acy#=curveangle(cy#,acy#,3)
yrotate object 100,acy#
set camera to follow object position x(100),object position y(100),object position z(100),object angle y(100),40,20+py#,30,0
rem Control matrix like water
for m=1 to 1
a#=wrapvalue(a#+1)
for z=0 to 36
for x=0 to 36
val1=10
val2#=0.25
val3#=15.0
x#=cos(a#+(x*val1))
y#=sin(a#+(z*val1))
nx#=0.0-(cos(a#+(x*val1))*val2#)
nz#=0.0-(sin(a#+(z*val1))*val2#)
ny#=1.0-nx#-nz#
set matrix height m,x,z,(x#+y#)*val3#
set matrix normal m,x,z,nx#,ny#,nz#
next x
next z
update matrix m
next m
sync
loop
denki
15
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 4th Dec 2002 09:58
That actually DID make me feel a little :X
lol Nice code

denki
Kousen DPB RPG latest - Working on editors!

Login to post a reply

Server time is: 2018-06-23 14:54:27
Your offset time is: 2018-06-23 14:54:27