S t a r t |
Diary |
Download |
Insight |
Questions? |
Food |
Links |
I m p r i n t |
Klick hier für die deutschsprachige Version. |
At this column you can learn to create your own egg-O-shOOter. |
<<< Chain links >>> |
---|
Let's manipulate our locomotive set, consisting of bird, banner and fly. Use the time steering to make them become faster after 3 seconds of time have passed by. As you already know, you need a further bird whose speed variables are higher to do so. The manipulations look like followed: ObjectF=T6 (The faster bird is activated during the time event.) ObjectD=T1 (The primary bird is deactivated during the time event.) ... ObjectSecMin=3 ObjectSecMax=3 The fast bird looks like this: #1# ObjectNumber=6 #1#Testobjekt schneller schraeger Vogel / Testing object fast odd bird ObjectFront=1 ObjectStartActive=0 ObjectTexture=79 ObjectF=-1 ObjectD=-1 ObjectSecMin=-1 ObjectSecMax=-1 ObjectConnect=-1 ObjectKoordPre=1 ObjectHitDirection=0 ObjectXMin_0 ObjectXMax_0 ObjectYMin_0 ObjectYMax_0 ObjectDMin=60 ObjectDMax=60 ObjectAMin=0 ObjectAMax=0 ObjectVXMin=-400 ObjectVXMax=-400 ObjectVYMin=0 ObjectVYMax=0 ObjectVRotMin=0 ObjectVRotMax=0 ObjectRotAxis=3 ObjectVGrowMin=0 ObjectVGrowMax=0 ObjectGravMin=0 ObjectGravMax=0 ObjectMoveXMin=-800 ObjectMoveXMax=+1000 ObjectMoveYMin=-1000 ObjectMoveYMax=+1000 ObjectMoveAMin=-360 ObjectMoveAMax=+360 ObjectMoveRMin=1 ObjectMoveRMax=1000 ObjectMoveType=3 ObjectType=1 ObjectBenefitMin=*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0 ObjectBenefitMax=*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0 ObjectMirror=0 ObjectMovePointing=1 ObjectHitSound= ObjectAppearSound= ObjectHitTextEnglish= ObjectHitTextGerman= Like intended, the odd bird alters from object 1 to object 6 - but what's that? The body of the bird accelerates and the remaining components stop moving! Well, the program code is doing exactly what we told to do. As soon as the slow bird is deactivated, the remaining components are missing their 'locomotive'. The 'waggons' have no speed component (ObjectVXMin/Max and ObjectYMin/Max) and so they stop. How can you avoid this? The answer is: 'Complicated, less complicated or simple'. The complicated, but manageable way is to create a second locomotive set with a faster bird in front which is deactivated at game start (ObjectStartActive=0) and will be activated during the time event. The less complicated way is to assign the 'wagons' a further 'locomotive', namely the fast bird. The variables of the 'wagons' (wing and banner) ObjectConnect=1 become ObjectConnect=1,6 This variable can consists of up to 20 comma separated object numbers and it is always the first ACTIVE object used for connecting. At game start object number 1 (the slow bird) is active and so banner and wing are connected at this object. During time event the slow bird is deactivated and the fast one activated, therewith object number 6 is the first active object and so becomes the 'locomotive'. Let's realize the simple way: We don't deactivate object number 1, but pass it new speed variables (those of object number 6). You can do this by altering the variables ObjectF=T6 ObjectD=T1 to: ObjectF=-1 ObjectD=T1/6 We omit the activation of object number 6 (ObjectF=-1) and replace the values of object number 1 by those of object number 6. Note that you still have to address object number 1, if you like to manipulate the bird during further events! If you like e. g. to make the fast bird become slow again (as soon as you hit the fast bird), you have to do the following alterations: ObjectF=-1 ObjectD=H1/1 Therewith you tell the program to assign the values of object number 1 to the bird, who holds the values of object number 6 before the hit. 3 seconds after the hit the bird accelerates again, because even the time values are newly initialized. If you hit the bird while flying from the left to the right, the bird immediately returns and moves to the right again. That is alright, because the horizontal speed values of object number 1 are negative. To avoid this behavior, you have to define two different birds (one flying to the left and one to the right) and to set the branches during the events - try it! Set the variable ObjectD=H1 of object number 6 (!), so that the fast bird will be deactivated whenever it is hit. Shoot at the bird and look what is happening: Like at the beginning of this chapter the 'wagons' stop moving. At the same way you can set ObjectD=H2 at the banner (Object 2). If you hit the banner, the fly starts flying around the point X=0, Y=0 in the egg-O-shOOter universe, because the reference 'banner' is missing. If you like the fly to move around the last residence of the banner, you should not deactivate the banner, but set the diameter of it to zero and loosen the connection (ObjectDMin/Max and ObjectConnect, with the help of another object). Whenever you break the chain at one point, the remaining links behave like the following link. If the bird disappears, the remaining links (banner + fly) behave like the banner had become the 'locomotive'. Because of the fact that the banner's speed is zero, those components stop moving. If the banner disappears, the components in front of it still move like nothing had happened and the component behind (the fly) is dropped. The fly has horizontal and vertical speed components. As long as the banner exists, the components are calculated relative to the speed of the banner. If the banner disappears, the speed components and the moving area become absolute values. |
<<<Back to object rotation 2 Continue with 'Conditioned branching'>>> |