You are on page 1of 4

Exemple de scripturi (Behaviour)

Miscarea sprite-ului la actionarea mouse-ului on mouseUp me sprite(me.spriteNum).locV=sprite(me.spriteNum).locV+7


end

Miscarea sprite-ului la actionarea mouse-ului property s on beginSprite me s=sprite(me.spriteNum) on mouseUp me sprite(me.spriteNum).locV=sprite(me.spriteNum).locV+7 end

Miscarea sprite-ului la actionarea mouse-ului property s on beginSprite me s=sprite(me.spriteNum) on mouseUp me s.locV=s.locV+7 end

Miscarea sprite-ului la actionarea mouse-ului (doar 4 mutari) property s property x on beginSprite me s=sprite(me.spriteNum) x=0 end on mouseUp me if (x<4) then x=x+1 s.locV=s.locV+7 end if end

Miscarea sprite-ului stanga-dreapta property s property d on beginSprite me s=sprite(me.spriteNum) d=#stanga end on exitFrame me if (d=#stanga) then s.locH=s.locH-10 else s.locH=s.locH+10 end if if (d=#stanga) and (s.locH<=0) then d=#dreapta else if (d=#dreapta) and (s.locH>=470) then d=#stanga end if end Miscarea sprite-ului stanga-dreapta cu pauza la punerea mouse-ului peste sprite property s, x, d on beginSprite me s=sprite(me.spriteNum) d=#stanga x=1 end on exitFrame me if (x=1) then if (d=#stanga) then s.locH=s.locH-10 else s.locH=s.locH+10 end if end if if (d=#stanga) and (s.locH<=0) then d=#dreapta else if (d=#dreapta) and (s.locH>=470) then d=#stanga end if end on mouseEnter() me x=0 end on mouseLeave() me x=1 end

Miscarea sprite-ului dupa cursor, atunci cand tinem click pe sprite property s,stare,d,l,n on beginSprite me stare=#oprit s=sprite(me.spriteNum) l=[] end on ExitFrame if stare=#miscare then s.loc=_mouse.mouseLoc + d l.add(s.loc) end if if stare=#animatie then if n<l.count then s.loc=l[n] n=n+1 else stare=#oprit end if end if end on mouseDown d=s.loc-_mouse.mouseLoc stare=#miscare end on mouseUp stare=#oprit if _mouse.doubleClick then animatie end on mouseUpOutside stare=#oprit end on animatie stare=#animatie n=1 end

Exemple de scripturi (Movie)


Miscarea sprite-ului dupa cursor, atunci cand tinem click pe sprite Trebuie sa fie Movie script, iar membrul sa se numeasca cerc (Member -> name) on rightMouseUp n=1 repeat while sprite(n).memberNum<>0 n=n+1 end repeat s=channel(n).makeScriptedSprite(member("cerc"),point(1,1)) s.width=7 s.height=7 s.loc=_mouse.mouseloc s.color=rgb(255,0,0) end

Cursuri.tk

You might also like