Hi guys. I got my very first Hollywood windowed application done, and it's available on Aminet. So, I did my first try with Sprites and drawing. Simply it's a randomly moved circle. And there are two things that really surprised me. First. The sprite often changes its speed significantly, while the speed is constantly set to 1. Second. Sprite's paths are not straight lines. Twice: why?
Here goes the code:
-------------------------------------------------------------- @VERSION 2,0 @DISPLAY {Width = 640, Height = 480} @SAMPLE 10, "Bells.wave"
Function p_CreateSprites() ; Circle SetFillStyle(#FILLCOLOR) CreateBrush(10, 12, 12) SelectBrush(10) Circle(0, 0, 6, #WHITE) EndSelect SetBrushTransparency(10, #BLACK) CreateSprite(1, #BRUSH, 10) EndFunction
p_CreateSprites()
x1=0 y1=0 DisplaySprite(1, x1, y1)
Function p_MoveRnd() x=Rnd(634) y=Rnd(474) Circle(x,y,3,#RED) MoveSprite(1, x1, y1, x, y, {Speed=1}) PlaySample(10) Circle(x,y,3,#BLACK) x1=x y1=y EndFunction
EscapeQuit(True) SetInterval(1, p_MoveRnd, 40)
; ; main loop! ; Repeat WaitEvent Forever ---------------------------------------------------------------------
and the executable:
Sprite 68k _________________ I miss draggable screens in MorphOS... and do you? I know I'm in a minority unfortunately. |