This wiki is out of date, use the continuation of this wiki instead

Angle

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:32, 14 November 2007 (edit)
Sandman (Talk | contribs)
m
← Previous diff
Revision as of 00:09, 25 December 2007 (edit) (undo)
Sandman (Talk | contribs)
m
Next diff →
Line 11: Line 11:
'''INT''' angle '''INT''' angle
-Angle is a predefined [[local variable]] which holds the angle (measured in 1/1000 of a degree) at which the [[graphic]] of that [[process]] (assigned by the [[graph]] [[variable]]) will be drawn.+'''Angle''' is a predefined [[local variable]] which holds the angle (measured in 1/1000 of a degree) at which the [[graphic]] of that [[process]] (assigned by the local variable [[graph]]) will be drawn. It also influences the result of the [[function]] [[advance]]().
== Example == == Example ==
To make the graphic of a process spin: To make the graphic of a process spin:
<pre> <pre>
-Process spinning_graphic()+Program spinning_graphic;
Begin Begin
- graph = load_png("image.png"); //load the graphic and assign it to the graph variable+ graph = new_map(100,100,8); //Create a cyan square and assign it to 'graph'
- x = 100; //Position the graphic 100 pixels+ map_clear(0,graph,rgb(0,255,255));
- y = 100; //from the top and left of the screen+ x = 160; //Position the graphic's center
 + y = 100; //in the center of the screen
Loop Loop
angle += 1000; //increase the angle of graphic by 1000 each frame. 1000 = 1 degree. angle += 1000; //increase the angle of graphic by 1000 each frame. 1000 = 1 degree.
Line 27: Line 28:
End End
</pre> </pre>
-This process will spin the graphic stored in the file "image.png" by 1 degree each frame.+This process will spin the cyan square by 1 degree each frame.
{{Locals}} {{Locals}}

Revision as of 00:09, 25 December 2007

Up to Local Variables



Definition

INT angle

Angle is a predefined local variable which holds the angle (measured in 1/1000 of a degree) at which the graphic of that process (assigned by the local variable graph) will be drawn. It also influences the result of the function advance().

Example

To make the graphic of a process spin:

Program spinning_graphic;
Begin
    graph = new_map(100,100,8);  //Create a cyan square and assign it to 'graph'
    map_clear(0,graph,rgb(0,255,255));
    x = 160;     //Position the graphic's center
    y = 100;     //in the center of the screen
    Loop
        angle += 1000;    //increase the angle of graphic by 1000 each frame. 1000 = 1 degree.
        frame;
    End
End

This process will spin the cyan square by 1 degree each frame.


Local variables
AngleBigbroFatherFileFlagsGraphIdRegionReservedResolutionSizeSize_xSize_ySmallbroSonXYZ
Personal tools