Алгоритм составления
1.Схема образа
2.Теория |
3.Математический алгоритм
программы |
4.Программа |
global Boot,a, n1,t0,t,R,n on beginsprite me my = sprite(me.spriteNum).member
my.resetWorld()
Boot =0
a=0
t0=0 t =0 n =0
my.newTexture("backdrop", #fromCastmember, member("sky"))
my.camera(1).insertBackdrop(1,my.texture("backdrop"), point(0,0), 0) ------------------------------------------------------------------------ set the url of member "Trousers"="Trousers.swa" ------------------------------------------------------------------------
--Óñòàíîâêà íà÷àëüíûõ óñëîâèé-------------------------- member("my").model("Sphere01"). transform.identity() --member("my").model("Sphere01").transform.translate(0,0,550 ) member("my").model("Sphere01").transform.translate(-30,0,15 ) --member("my").model("Sphere01").transform.translate(95,0,15 ) ------------------------------------------------- end on exitFrame me --set the url of member "Trousers"="Trousers.swa" --
if (a=1) then --ìóçûêà myButton --------------------------------------------
--n1 =n1 + 1--ñ÷åò÷èê
--------------------------------------------
--Àëãîðèì îáðàáîòêè
--óñëîâèå îáðàáîòêè
---------------------------------- zz=member("my").model("Sphere01").transform.position.z xx=member("my").model("Sphere01").transform.position.x --if (member("my").model("Sphere01").transform.position.y=0) AND (zz >0) then
if xx <=95 AND (zz =15) then
vertecal
Else
Round
end if --AND-------------------------
-------------------- --Round --vertecal ----------------------------------------------- -- if member("my").model("Sphere01").transform.position = vector( 0.0000, 0.0000,0 ) OR (member("my").model("Sphere01").transform.position <= vector( 0.0000, 0.0000,0 ) ) then
-- Round
-- end if --AND------Round-------------------
----------------------------------------------- --Øàã çà øàãîì
--1 øàã
end if
--Sphere01
go the frame
end
-- ñîçäàíèÿ îáðàáîòêè äàííûõ
--Button on myButton if Boot=0 then
--set the url of member "Trousers"="Trousers.swa" play (member "Trousers")
Boot=1 end if
end --myButton ----
on Round
------------------------------------------------------------
-----------------------------------------------------
---------------------------------------------
-----------------------------------------
--t = t0+(n1-1)*0.35 --ñóùíîñòü âñåé ñèñòåìû
--Ãäå
--h(n)-h(0) =h(n)-h(n-1) =h(n+1)-h(n) =1 --ïðèðàùåíèå
--h0-íà÷àëüíîå óñëîâèå
-- n1 - ñ÷åò÷èê
-----------------------------------------
---------------------------------------------
----------------------------------------------------- n =n + 1--ñ÷åò÷èê t =0+n*0.1-- --t(n)-h(0) =t(n)-t(n-1) =t(n+1)-t(n) =0.1 --ïðèðàùåíèå âðåìåíè
--power(base, exponent) --power(2,3)--âîçâåäåíèèå â ñòåïåíü b ÷èñëî à íàïðèìåð 222=8 --e=2.71828 --abs --put sqrt(25.0)=5 ------------------------------------------------------------------------------------------------------------- E=3*(power(2.718,-t/20))
u=aTan(-0.055)
If sin(t+0.5+u) >= 0 then
member("my").model("Sphere01").translate(-1,0,1*E*(1*cos(t+0.5)-(1/20)*1*sin(t+0.5)))
---------------------------------------------------------------------------------------------------------------------------- else member("my").model("Sphere01").translate(-1,0,-1*E*(1*cos(t+0.5)-(1/20)*1*sin(t+0.5)))
end if
end -- Round
--member("my").model("SphereZZ"&SN&n).transform.position
on vertecal -- member("my").model("Sphere01").translate(0,1,-sqrt(2*9.8*member("my").model("Sphere01").transform.position.z)) member("my").model("Sphere01").translate(6,0,0) end -- Round --put member("my").model("Sphere01").transform.position --member("my").model("Sphere01"). model.transform.identity() --member("my").model("Sphere01").model.transform.translate(100,0,0) --put member("my").model("Sphere01").transform.position.y
|