Hello Batman,
TNX for your tip!
I have been fixing the problem.
I changed the code from
position object d,ox#,cos(m*((d-1)))*100,oz#
into
position object d,ox#,cos(m#+(d*balls_size#)*wave_height#,oz#
The little program I now have made a little interactive. You can change the variables.
Look for this code:
REM *********************
REM **SIMPLE WAVE_BALLS**
REM *********************
autocam off:hide mouse
REM CHANGE THE VARIABLES
balls#=25
balls_size#=50
wave_height#=50
speed#=4
REM MAKE THE WAVE FIT ON THE X-SCREEN
camx#=(balls#*balls_size#)/2
REM MAKE THE BALLS
for n=1 to balls#
make object sphere n,balls_size#
position object n,(n*balls_size#)-balls_size#,0,0
next n
REM PUT SYNC ON AND HIDE MOUSE
sync on : Hide Mouse
REM POSITION CAMERA USE CAMX
position camera camx#,100,-1000
color backdrop RGB(0,0,0)
REM USE A VARIABLE AT 0 TO START THE SINUS_BALLS
m#=0
REM MAIN LOOP
REPEAT
gosub keys
m#=m#+speed#
m#=wrapvalue(m#)
for d=1 to balls#
ox#=object position x(d)
oz#=object position z(d)
position object d,ox#,cos(m#+(d*balls_size#))*wave_height#,oz#
next d
sync
text 0,0,"Wrapvalue: "+str$(m#)
text 0,15,"Speed: "+str$(speed#)+" CHANGE WITH KEYLEFT AND KEYRIGHT"
text 0,30,"WaveHeight: "+str$(wave_height#)+" CHANGE WITH KEYUP AND KEYDOWN"
UNTIL SPACEKEY()
REM END THE PROGRAM
END
REM THE LIST OF KEYBOARD CODE TO MAKE THE MAINLOOP SMALLER
keys:
if leftkey()
speed#=speed#-0.1
endif
if rightkey()
speed#=speed#+0.1
endif
if upkey()
wave_height#=wave_height#+0.5
endif
if downkey()
wave_height#=wave_height#-0.5
endif
RETURN
Maybe beginners have fun with it?
Now lets change colors!!
lol
Greetings!
Toedeledoki