1
Technical forum / Stars of the background
« on: November 21, 2005, 11:58:45 AM »
All greetings!
I try to make running up stars, from the center to edges of the screen.
Also there were some questions:
1. How to place sprite stars in a starting position after she has reached edge of the screen?
2. Why twitching moving of stars, though FPS = 100 is appreciable?
The script of a star is resulted below:
Can eat easier with the decision?
I try to make running up stars, from the center to edges of the screen.
Also there were some questions:
1. How to place sprite stars in a starting position after she has reached edge of the screen?
2. Why twitching moving of stars, though FPS = 100 is appreciable?
The script of a star is resulted below:
Code: [Select]
#include "scripts\base.inc"
//this script moves the stars of the background of the menu
//start on center
self.X = 1024/2;
self.Y = 768/2;
//ramdom movement direction
var a = Random(0,359);
var incX = sin(a);
var incY = cos(a);
while(true)
{
//move the sprite
self.Y = self.Y + incY*4;
self.X = self.X + incX*4;
Sleep(20);
}
Can eat easier with the decision?