User Tools

Site Tools


pf:createparticle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pf:createparticle [2015/03/01 21:59] virgilwpf:createparticle [2015/03/04 16:56] (current) – removed Karsten75
Line 1: Line 1:
-~~DISCUSSION~~ 
-<- [[pf:alphabetic_list_of_commands| Alpha List of Commands]] <-[[class link]] <-[[pf:prpl_information|PRPL home]] <-[[pf:start| Game 4 home]]   
-=====  CreateParticle   ===== 
- 
-^Arguments^Result^Notation^ 
-|Pixel coordinates, direction, speed, type, enemy | Particle UID. | ''f1 f2 f3 f4 i1 i2 -- ''| 
- 
-=== Description === 
- 
-Creates a particle with the given position and velocity. The angle is measured counterclockwise, and angle 0 is to the right. Currently the possible values for "type" are: 
- 
-^Type^Description^ 
-|0|The default round particle which is attracted to ships and energy sources.| 
-|1|A square particle which travels in a straight line and damages ships only.| 
- 
-If the "enemy" argument is false, the particle will be blue and harmless. It will still be attracted to ships but will happily float under them. 
- 
-Note: Particle speed is limited by the default speed. Default speed is 0.75 pixels per frame. Higher speeds are clipped to the default speed unless the default speed is changed by calling the [[SETPARTICLEMAXSPEED]] function. This has to be called for every particle created.  
- 
-=== How to use === 
- 
-| Standard CRPL | //x y direction speed type enemy // **createparticle **   | 
-| Warp notation | **createparticle** (//x y direction speed type enemy//) | 
- 
-=== Examples === 
-Create an enemy particle moving up and capture its UID. 
-<code> 
-@CreateMyParticle 
- 
-:CreateMyParticle 
-CreateParticle(CurrentPixelCoords 90 1.6 0 1) ->p 
-SetMaxParticleMaxSpeed(<-p 2.0) 
-</code>  
- 
-=== Raw Code === 
-<code> 
- case STATEMENT.CREATEPARTICLE: 
-                    i2 = GetIntFromStack(); //enemy 
-                    i1 = GetIntFromStack(); //particle type 
-                    f4 = GetFloatFromStack(); //Speed 
-                    f3 = GetFloatFromStack(); //direction in degrees 
-                    f2 = GetFloatFromStack(); //y 
-                    f1 = GetFloatFromStack(); //x 
-</code> 
  
pf/createparticle.1425247167.txt.gz · Last modified: 2025/02/14 14:56 (external edit)