Better 3D Starfield Effect
Author: | Chrisbo
|
Submitted: | 11th October, 2002
|
Views: | 5721
| Rated: |
|
|
This is a much easier way of creating a 3D starfield effect than the other way that was just posted. This example is for a 640*480 window. Adjust the numbers as necessary to accomodate to your window size.
First create your star graphic. Set the animation speed to like 8 or 10. 5 frames should be good. (zooming in) Set it to ball movement with an initial speed of 0. Now do the following events:
Always:
Create "star object" at -100,-100 // I create the stars outside the play area to keep things clean while the positioning is going on
Set X position "star object" to random (640)
Set Y Position "star object" to random (480)
Look in direction of "320,240" // this is half of 640*480, meaning the center of the window
Set direction "star object" to current direction +16
Set speed "star object" to current speed +1
"star object" leaves playarea:
destroy
And there you go. If you're too lazy to do that, download the demo I made: http://www.nwhonda.net/download/starfield.zip
|
|
Chrisbo
Registered 02/01/2002
Points 794
|