by Novice » Thu Feb 02, 2006 12:50 am
3. Well, whenever the timer counts once create the actor rock.
RockCreator-->Timer(RockCreatingTimer)-->Create Actor ("Rock");
4.On create actor event (in the rock atributes Rock-->create actor-->script editor)you set the rock so that it apears on a random x position, wich is rounded by the round(); function because the rand function creates float numbers and you have to round them down (you cant have a decimal x value like x=77,3) and you get a random number betwen 0 and 640 presuming that 640 is your screen width, then you add the x value of the screen because when you move the screen left or right (i just rememberd i told you to parent it so that elimnates the +view.x part of the function but il explain just in case) the value is changed to ex. -100 but the rocks are still created beween 0-640, get it?So you add them up (0 to 640) +(-100)=-100 to 540.
5.with the fifth function you check on each drawing of the rock (rock-->draw actor-->script editor) if the rock has fallen down enoug so you cant see it no more and if it did it destroys it, i could have used the Out of vision function but then you wouldn't be able to create the rock above the screen (because it is eaven then out of vision).
Why do i always get stuck?