Hi everyone I am having quite hard time with my "HUD".
1-My first levels in my game were only one screen and had no scroll but now I wanted to add some scrolling effect for advancement.
3-My Game is only going to right & left so no jumping involved.
4-I created a seperate sprite with scrolling behaviour and set my player's X &Y position to that created sprite. I set the new sprite to invisible.
5-I set my HUD in a different layer with Parallax 0,0 it stays where its at during scroll.
6-BUT in my game event I have a thing.
-When the player collects a coin, it is destroyed and a new coin is created which has a bullet behaviour and flies straight to the position of the COIN sprite in my HUD.
-When the spawned coin touces the Coin in Hud 1 COIN is added to the COIN Value. And the spawned COIN is obivously destroyed.
So there are three COINS for this example.
1-Coin Collected inside Stage.
2-Coin Spawned.
3-Coin Icon in HUD.
This is my event for coin flying towards Coin in HUD.
angle(goldcoin_collect.X, goldcoin_collect.Y, goldcoin_GUI.X, goldcoin_GUI.Y)
Check the picture. (Mario and Coin is only reference I am not using them in my main game)
Ok this was working fine until I started to scroll my Game Area.
Like I said I set my HUD to Parallax 0,0 and arranged its position so it always stays on screen when there is a scroll.
BUT the problem is when the player goes the far right of the screen as scrolling the game area I guess the image point of the COIN in HUD stays on the far left side. (where it is originally in my editing screen)
So when the player is at the far right side the swapned COIN flies to the far left of the Game Area instead of going up to the COIN in HUD to touch it.
To mention I also have a game area 1280x720 and at the beggining I set scroll to X-640 and Y-360 to center the screen.
I also tried the Anchor behaviour instead of Parallax but that is really lacking and slow (in mobile looks more awful) and seems unproffesional . Or maybe I am doing something wrong.
I really would appreciate the help on this and hope there is a solution.