'
' The Mad Robot Demo
'
' By Nick Harper
'
' (c) Copyright Europress / VooDoo Software 1991
'
'
'
Curs
Off: Flash
Off ' text cursor off, turn off the flashing colour sequenceScreen Open 0,320,200,16,Lowres
'Screen Open number,width,height,colours,pixel mode ' Lowres = 320 pixels wide
Cls 0 'Cls colour number--> paint alla screen with 0 (black as default) ' Td seems being like a metacommand for IDE AMOS to let execute only
' on running the command of IDE like setting path of files, loading files to use
Td
Screen Height
200 '(Set the screen height to drawing)Td Dir "amsopro_system:AMOS_3d_demos:/objects" ' Set the object directory name)
Td Load "torso" ' Load the named object -->load 6 object models_Images
Td Load "leg"
Td Load "arm"
Td Load "head"
Td Load "stool"
Td Load "animcube"
' FADE blend colours to new values, Fade speed set the speed of the fade
'by choosing the number of vertical blank periods between each colour change
'Fade effects are executed using interrupts, so it is sensible to wait until the fade has ended before going on to the
'next program instruction. The length of wait required can be calculated with this formula:
'wait = fade speed * 15
'
Td Object 1,"torso",0,900,5000,0,0,0 ' Create an object
Td Object 2,"leg",-200,700,5000,0,0,0 ' Object NumObject,"NameModel", x1,y1,z1,Ax,Ay,Az
Td Object 3,"leg",200,700,5000,0,0,0 ' x1,y1,z1 are cohordinates
Td Object 4,"arm",-300,1200,5000,0,0,-5000 'Ax Ay Az are angles of rotation along X Y and Z axises
Td Object 5,"arm",330,1350,5000,0,0,0 ' these angles are expressed as VRU--->> Voodoo Rotation units
Td Object 6,"Head",0,1400,5000,0,0,0 ' 360 celsius = 65536 VRU
Td Object 7,"stool",1000,-300,4500,0,0,0 ' celsius = VRU / 182
Td Object 8,"stool",-700,-300,6500,0,0,0 'VRU = celsius * 182
Td Move 0,1500,1000,500 ' move objecte 0 at cohordinates x y z
Td Face 0,1 ' Point an object 0 to object 1 calculating range between and angles A and B joining them
Double Buffer : Autoback
0 'DOUBLE BUFFER Instruction activate the double buffering system 'creates an invisible copy of the current screen and stores it as a "logical screen". All graphics
'operations, including Bob movements, are now performed directly on this logical screen, without disturbing your
'existing display at all.
' Autoback 0 deactivates autoback system
'autoback 1 activates SEMI_AUTOMATIC mode, text and graphics operations are made on logic and phisical screen, No BOB action
' Autoback 2 FullyAutomatic, every graphic operation on the screen is synchronized with BOB active
'AUTOBACK is extremely intelligent and completely automatic, but it can only synchronise graphics and text
'commands
Td
Cls ' (Clear the 30 display area with extra speed) savind 2D graphicsTd Redraw 'Draw al! current visible 30 objects
Hide
On ' hide mouse cursorFade 1,$F38,$FFF,,,,,,,$FB9,$7F,$F,$BF,$A00,$500
' fade 9 colours of original 15
' they seem variables
HEAD=160
LLEG=200 : LLEGS=0
RLEG=-250 : RLEGS=1
USX-150 : USZ=150 ' here USX = -150
BOUNCE=200
Set Rainbow 0,0,250,"(15,1,2)","(6,1,2)","(9,1,2)" ' define a rainbow
'Set Rainbow number,index,height,red$,green$,blue$
' number of rainbow from 0 to 3
' index is the color index that is to be changed, and only colours 0 to 15
' can be affected. In practice,
' this colour can be assigned a different value for each horizontal screen
' scan line, if necessary.
' it sets the height of the rainbow in units,
' with each unit ready to hold one scan line of colour
' it can range from 16 to 65500, but only the first 280 can be displayed
'on screen at once
' the Red, Blue and Green components of the rainbow colours are set up as strings, each within their own
' brackets, their format comprises three values (number,step,count)
' the number of scan lines assigned to one colour value
' Step is a value to be added to the colour, which controls the colour change
' Count is simply the number of times this whole process is performed.
Rainbow 0,0,156,94
'display a rainbow
'Rainbow number,offset,vertical position,height
' The offset sets the value for the first colour in the table created with SET RAINBOW
'number 0-3 , The vertical position is a coordinate which must have a minimum value of 40, and it affects the starting point of the
' rainbow's vertical display on screen
' sets the rainbow's vertical height in screen scan lines
'
BODY=0 : BODYI=1
Td Face 0,1 ' Point an object 0 to object 1 calculating range between and angles A and B joining them
Td
Cls ' (Clear the 30 display area with extra speed) savind 2D graphics Td Redraw 'Draw al! current visible 30 objects
Wait Vbl
' wait for the next vertical blank period
HEAD:
Td Move Rel 6,0,HEAD,0 'Move an object relative to its current position)
Td Angle Rel 6,0,0,1927
HEAD=HEAD-20
HEAD=160
ANG=Td Attitude C(6)
LEFT_ARM:
Td Angle Rel 5,0,2000,0 ' can make objects execute smooth turns
'simply by changing the attitude gradually
'Set up an angle animation string applies the changes specilied by
'the movement string angle$ to either A, B or C.
Td Anim Rel 5,4,0,HEAD,0,1
Td Move Rel 5,0,-HEAD,0 'Move an object relative to its current position)
RIGHT_ARM:
Td Angle Rel 4,3854,0,0
'Set up an angle animation string applies the changes specilied by
'the movement string angle$ to either A, B or C.
ANG=Td Attitude C(4) ' (Return an object's attitude A or B or C
If Abs(ANG
)<2000 Then Td Angle
4,0,0,0 'Set up an angle animation string Return 'Abs give an absolute value
LEFT_LEG:
If LEGS
=0 Then Td Move Rel
3,0,LLEG
,0 If LEGS
=0 Then Td Anim Rel
3,4,0,-LLEG
,0,1 'This command applies a change (called a delta) to point p of object n. If LLEG
=-250 and LLEGS
=1 Then BNC
=1 : Boom
'generate explosive sound effect If LLEG
=-250 Then Inc LLEGS
'increment an integer variable by one unit IF LLEGS
=9 Then LLEGS
=0 : LLEG
=200
RIGHT_LEG:
If RLEGS
=0 Then Td Move Rel
2,0,RLEG
,0 'Move an object relative to its current position) ' Td MOVE REL n,dx,dy,dz The movement it applies though, is relative
' to the object's current position.
If RLEGS
=0 Then Id Anim Rel
2,4,0,-RLEG
,0,1 '(Apply change to a point - relative to the points position)
'This command applies a change (called a delta) to point p of object n.
' The change to be applied is specified by x, y and z.
' The change is applied to the object as it was saved under OM.
If RLEG
=250 and RLEGS
=1 BNC
=1 : Boom
If RLEGS
=9 Then RLEGS
=0 : RLEG
=200
SHIFTEM:
Td Move Rel 0,USX,0,USZ ' 'Move an object relative to its current position
if Td Position X
(0)-Td Position X
(1)>4000 Then Add USX
,-10 ' range x If Td Position X
(1)-Td Position X
(0)>4000 Then Add USX
,10 If Td Position Z
(0)-Td Position Z
(1)>4000 Then Add USZ
,-10 If Td Position Z
(1)-Td Position Z
(0)>4000 Then Add USZ
,10
BOUNCES:
Td Move Rel,7,0,BOUNCE,0 'Move an object relative to its current position)
Td Move Rel,8,0,BOUNCE,0 'Move an object relative to its current position)
Add BOUNCE,-100
If BOUNCE
=-300 Then BOUNCE
=200 : BNC
=0
BODY:
Td Surface
"animcube",0,BODY
To 1,0,0,2'(Copy a surface)
'Td SURFACE name1 ,b1 ,f1 to n2,b2,f2,rt
' name1 = source object name, b1 block number within name1
' face number within b1
' n2 number destination object b2 block number within n2
' f2 face number within b2 , rt rotation angle (0-3)
Add BODY,BODYI ' ADD does sum of BODY and BODYI