Problem: need solving. Camera control.
giacomopoppi
Member, PRO Posts: 914
hi ive got my game here:
http://gamesalad.com/game/play/37009
what i need help with:
when i create a tower of blocks and it falls the camera view doesnt go down with the blocks.
i need a sort of rule saying that when there are no more actor "blocks" in the Camìera view move down speed 150.
how do i do this, or something similar?
http://gamesalad.com/game/play/37009
what i need help with:
when i create a tower of blocks and it falls the camera view doesnt go down with the blocks.
i need a sort of rule saying that when there are no more actor "blocks" in the Camìera view move down speed 150.
how do i do this, or something similar?
Comments
Might be your best bet.
try the game and you will notice. the aim of the game is to get the highest tower of blocks you can.
you would need to keep track of the height of the tower globally, and constrain the Y position of the invisible actor to the global game.towerHeight...
Something like this...
A global game attribute (real) called towerHeight
Every block would need something like this:
In the block actor, add two boolean attributes called:
isOnTower
hasAddedToTowerHeight
Add a rule that says:
Rule
ALL
When self.Position.Y > 0
When self.Position.X > 0
When self.Position.X < game.sceneWidth
Change Attribute: self. isOnTower to TRUE
Otherwise
Change Attribute: self. isOnTower to FALSE
Another rule that says:
ALL
When self. isOnTower is TRUE
When self. hasAddedToTowerHeight is FALSE
Change Attribute: game. towerHeight = game. towerHeight + self.Height;
Change Attribute:self. hasAddedToTowerHeight to TRUE
And another rule that says:
ALL
When self. isOnTower is FALSE
When self. hasAddedToTowerHeight is TRUE
Change Attribute: game. towerHeight = game. towerHeight - self.Height;
Change Attribute:self. hasAddedToTowerHeight to FALSE
In the invisible Camera Controller:
Constrain Attribute
self.Position.Y To: game.TowerHeight
Control Camera
That SHOULD do the trick...
Just off the top of my head...
Hope this helps!
Joe