Hello there people! Today we will be doing advanced objects. All it is is one new command. Yesterday we learned OBJCT.SET and OBJCT.MOV. Today we will learn to resize objects using OBJCT.SIZ. Syntax:
OBJCT.SIZ[control number,scale]
Scale is the size of the object. 1 is normal, 2 is double size, 0.5 is half size, and so on. Let's make a game! NOTES: VCLR clears all strings and variables. OCLR clears all objects, GCLR clears all graphics, and TCLR clears all text.
'Sprite game!
VCLR
TCLR
GCLR
OCLR
SETV VAR[1]=1
SETV VAR[X]=5
SETV VAR[Y]=5
SETV VAR[5]=5
OBJCT.SET[0,5;5,0]
GOTO TARGETSETUP
MAINLOOP:
GOTO MOVE
MOVERETURN:
GOTO RANDTEST
RANDTESTRETURN:
GOTO MAINLOOP
MOVE:
WHEN BUT[]=1 DO{
MATH Y=Y-5
OBJCT.SET[0,0;0,3]
}
WHEN BUT[]=2 DO{
MATH Y=Y+5
OBJCT.SET[0,0;0,1]
}
WHEN BUT[]=4 DO{
MATH X=X-5
OBJCT.SET[0,0;0,2]
}
WHEN BUT[]=8 DO{
MATH X=X+5
OBJCT.SET[0,0;0,0]
}
SLP[0.1]
GOTO MOVERETURN
TARGETSETUP:
RAND PUSH(NULL) MAX[050]=x
RAND PUSH(NULL) MAX[037]=y
MATH x=x*5
MATH y=y*5
OBJCT.SET[1,0;0,4]
OBJCT.MOV[1,x;y]
GOTO MAINLOOP
RANDTEST:
WHEN VAR[X]=x DO{
WHEN VAR[Y]=y DO{
TCLR
MATH S=S+1
OUT<VAR[S]
GOTO TARGETSETUP
}
}
WHEN BUT[]=16 DO{
STOP
}
GOTO RANDTESTRETURN