Post by Ed-2D on Mar 23, 2005 8:55:34 GMT
I found a way to generate projectile path function.
I decided to create an special editor.
Last Update:
--------
- hit SPACE to launch projectile
- damping effect
- yellow selection mark
- select point
- drag point
- drag start point to move entire path
- DOUBLE CLICK to delete point
- MOUSEWHEEL to scale path
- save CPU time when you use 'edit' mode
- use list to select point
- GUI point list
- GUI buttons : change screen size
- GUI buttons : Add / Remove / Insert point
- GUI options : move, rotation, damping options, path duration, unlimited path
- GUI options : Align start point, flipV, flipH
- generate SPRITE CANDY code
- doted line for unlimited path
- real path visualization
- grid setting CTRL + / CTRL -
- config.ini
ToDo:
--------
- Userlib : HUD_LoadPath, HUD_AttachPath
- split line to insert point
- loop
ed.folio.free.fr/download/Path Editor.jpg[/img]
code exporter result :
I decided to create an special editor.
- download : Path Editor.zip ( unzip this file )
Last Update:
--------
- hit SPACE to launch projectile
- damping effect
- yellow selection mark
- select point
- drag point
- drag start point to move entire path
- DOUBLE CLICK to delete point
- MOUSEWHEEL to scale path
- save CPU time when you use 'edit' mode
- use list to select point
- GUI point list
- GUI buttons : change screen size
- GUI buttons : Add / Remove / Insert point
- GUI options : move, rotation, damping options, path duration, unlimited path
- GUI options : Align start point, flipV, flipH
- generate SPRITE CANDY code
- doted line for unlimited path
- real path visualization
- grid setting CTRL + / CTRL -
- config.ini
ToDo:
--------
- Userlib : HUD_LoadPath, HUD_AttachPath
- split line to insert point
- loop
ed.folio.free.fr/download/Path Editor.jpg[/img]
code exporter result :
Function HUD_Path(ObjectID, EmitterID, relative%=0)
Local x,y,dx#,dy#
Local xEM,yEM,angleEM=0
;init position
Local Obj.SC_Object = Object.SC_Object(EmitterID) : If Obj = Null Then RuntimeError SC_BreakText("HUD_Path||The specified Object does Not exist.",50)
xEM=Obj\x
yEM=Obj\y
If relative Then angleEM=Obj\rotation
HUD_PositionObject ObjectID,xEM,yEM
HUD_SetObjectRotation ObjectID,angleEM
;hidden target
Local target=HUD_CreateShape (Obj\LayerID,"RECTANGLE",1,0,0,0,0,0)
HUD_PositionObject target,xEM,yEM
HUD_SetObjectVisibility target,0
;follow FX
HUD_FX_FollowObject ObjectID,target,0,0,1
HUD_FX_FaceObject ObjectID,target,0
;waypoints
angle=(17.7447+angleEM) mod 360
x=xEM+SC_Sin(angle)*131
y=yEM-SC_Cos(angle)*131
HUD_FX_MoveTo (target,x,y,383,0,0,0)
angle=(75.8157+angleEM) mod 360
x=xEM+SC_Sin(angle)*94
y=yEM-SC_Cos(angle)*94
HUD_FX_MoveTo (target,x,y,333,0,0,383)
angle=(41.9606+angleEM) mod 360
x=xEM+SC_Sin(angle)*160
y=yEM-SC_Cos(angle)*160
HUD_FX_MoveTo (target,x,y,283,0,0,716)
;unlimited path
angle=(153.435+angleEM) mod 360
dx#=5000.0*SC_Sin(angle)
dy#=-5000.0*SC_Cos(angle)
HUD_FX_MoveTo (target,x+dx,y+dy,14620,0,0,999)
HUD_FX_AutoRemove target,15620
End Function