Bug or not- you shell decied.. i runned out of ideas.
roimulia
Member Posts: 12
Please.. i need to understand either it's bug or not.
I't might be challenge for you guys !
http://photouploads.com/images/sketchkkk.png
/
http://photouploads.com/images/sketchkkk.png
In the Sketch above you will see point's from 1 -8.
i managed to randomly respawn actors*(lets call him ENEMY)* ONLY from these 8 points.
Each actor that will be respawned from one of these points.. will have to
Interpolate(Move) to the OPPOSITE POINT on the screen,
Example :
from Point 1- to 5
from point 2- to 6
from point 8- to 4
and so on..
Now, in the Enemy screen(where you add rules,attributes and etc'), I added these 2 attributes:
just sharpen one point: the Self.X and Self.Y of the respawned Enemy must be 1 of the 8 positions in the Sketch.
Interpolate(Self.X) To --> abs((self.X)- Screen.DisplaySize.Wieth)
Interpolate(Self.Y) To --> abs((self.Y)- Screen.DisplaySize.Height)
this way i tought(and still thinking) that he will always !!! go to the oppsite point..
Self.X and Self.Y(and i checked it with logs) could be 3 options : 0 , DisplaySize/2 , max DisplaySize
so it's a must that, that way he will reach to the opposite.. but the Enemy actor Interpolate to the Middle(not matter where they respawned from).. always end in the middle.. i think it's a bug.. Please help me.. thank you .. ! (:
I't might be challenge for you guys !
http://photouploads.com/images/sketchkkk.png
/
http://photouploads.com/images/sketchkkk.png
In the Sketch above you will see point's from 1 -8.
i managed to randomly respawn actors*(lets call him ENEMY)* ONLY from these 8 points.
Each actor that will be respawned from one of these points.. will have to
Interpolate(Move) to the OPPOSITE POINT on the screen,
Example :
from Point 1- to 5
from point 2- to 6
from point 8- to 4
and so on..
Now, in the Enemy screen(where you add rules,attributes and etc'), I added these 2 attributes:
just sharpen one point: the Self.X and Self.Y of the respawned Enemy must be 1 of the 8 positions in the Sketch.
Interpolate(Self.X) To --> abs((self.X)- Screen.DisplaySize.Wieth)
Interpolate(Self.Y) To --> abs((self.Y)- Screen.DisplaySize.Height)
this way i tought(and still thinking) that he will always !!! go to the oppsite point..
Self.X and Self.Y(and i checked it with logs) could be 3 options : 0 , DisplaySize/2 , max DisplaySize
so it's a must that, that way he will reach to the opposite.. but the Enemy actor Interpolate to the Middle(not matter where they respawned from).. always end in the middle.. i think it's a bug.. Please help me.. thank you .. ! (:
Comments
Hi @roimulia
You seem to have fixed spawn positions, as well as fixed positions they travel to, sorry I'd simplify the situation.
First to say, just duplicate your spawn actor in the Inspector another 7 times - if the image is the same, believe me, it won't add any file size. In each of them, you can put its individual Interpolate x and y behaviours, and the coordinates to go to can be just numbers, i.e the exact pixel points (because if its Spawn number 1, that'll travel to 480 x and 0 y, for instance (example based on iPhone 4); spawned number 2 interpolates just the x to 180, etc.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I thought about that, but I need that every one second(for example) it will Randomly choose one of the right spawners, how so I do that?
@roimulia A straightforward way would be to make an integer attribute, lets call it Pick.
Then in the Rules of an actor outside the screen area (or perhaps you're putting it in button on-screen? - either way):
Timer: Every 1 second
Change Attribute Pick to random(1,8)
Rule: When Pick = 1
Spawn 1stActor x + y coordinates set for position
Rule: When Pick = 2
Spawn 2ndActor x + y coordinates set for position
Rule: When Pick = 3
Spawn 3rdActor x + y coordinates set for position
etc., up to 8
So providing you've got your interpolate behaviours in all 8 of your spawn actors, the moment they are spawned in place, they will move to their new positions.
i'm not sure of what type of game you're making or any of the gameplay, but just to point out the obvious: as the random will generate duplicate numbers, the spawned actors will build up in piles on the opposite sides, and if all the spawn actors are the same image/colour, you won't see any new ones spawn after a short while...
A simple solution to that (as I say, if it fits in with your gameplay) is to add at the end of all the 8 spawn actors, a Timer after the interpolate(s):
Timer: After ?? seconds -- ?? same as duration in Interpolate
Destroy
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I thought about that, but in the same breath I wanted to make it to dynamic and make an global expression, and it's killing my head cuz logically what I did must work, i checked it with logs and every thing.. I guess my last option will make it case - sensitive with random attribute.. There is any way you find the problem in what I have originally done? Thank you for your replys man !
Interpolate(Self.X) To --> abs((scene.Pos1X)- Screen.DisplaySize.Width)
Interpolate(Self.Y) To --> abs((scene.Pos1Y)- Screen.DisplaySize.Height)
This is untested, but I think that should work for you now.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps