|
| Let's Draw Game-Editor Tutorial In this demo we will draw a random starfield of random colors. You can make the starfield denser by continually selecting the Down Arrow. the fantastic Game-Editor setpen(), moveto() and putpixel() functions are demonstrated here along with the C rand() function and the C for loop control LET'S
DRAW A RANDOM STARFIELD 2. Go to Config and change Game resolution to 240 x 320 Pocket PC (for Pocket PC resolution). 3. Resize your Canvas Actor to the View Size. I make mine look like this. 4. Right-Click over your Actor and select Actor Control | Events | Add | Key Down - and press the Down Key. Then select Add Action | Script Editor. 5. Enter the following code into the Script Editor (or cut and paste): //Random
Starfield for(loopCount=1; loopCount<1000; loopCount++) {
7. Go into Game Mode and press the Down Arrow to try it out. Here is how your program will look:
Here we have only drawn points, NEXT we will cover drawing lines and shapes like this little program I wrote called Imagine.
LET'S DRAW A CIRCLE!
In my example the value 100 is the diameter. The 120,160 values are the x,y center of the circle. You
can edit these values all you want. For example, if you use 50 as a multiplier
for one of the cos/sin values and leave the other at 100 you will get a 45 degree
ellipse like this:
//Old
School Circle Routine int
loopCount = 100; for(loopCount=0; loopCount<360; loopCount++) { LET'S DRAW A GRADIENT
//Gradient
Code for(loopCount=0; loopCount<320; loopCount++) { setpen(0,0,bColor,0,1);
LET'S DRAW A CARDIOID!
//Cardioid
Code moveto(0,y/2); for(i=-100;i<=100;i+=.005)
That's
it!
©Copyright TrajectoryLabs.com. All Rights Reserved. | ||||