Be a Supporter!

parallax scrolling/stationary stats

  • 171 Views
  • 2 Replies
New Topic Respond to this Topic
Hero101
Hero101
  • Member since: Dec. 13, 2005
  • Offline.
Forum Stats
Supporter
Level 22
Game Developer
parallax scrolling/stationary stats 2013-12-06 20:40:40 Reply

So I'm working on a new test game (it's what I do to better grasp new code I'm learning) and I'm working with parallax scrolling with that top down view. I get how it works and how I can control the boundary box around my player.

But what if I wanted stationary stats on the screen. Like the score or the number of lives remaining for the player. How would I do that?

Like would I attach them to the boundary box? Is that even possible? The player? It can't be the stage cuz with parallax scrolling it would just move or disappear as the player walks around.

As you can probably tell I still have a lot to learn but I'm working on it and you guys have always been a great help to me so far.


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Online!
Forum Stats
Supporter
Level 16
Game Developer
Response to parallax scrolling/stationary stats 2013-12-06 20:46:08 Reply

At 12/6/13 08:40 PM, Hero101 wrote: But what if I wanted stationary stats on the screen. Like the score or the number of lives remaining for the player. How would I do that?

Have (at least) two "layers": a ui layer and a display layer. You would add the player, background, and parallax stuff to the display layer. Then addchild the ui layer on top of the display layer. You probably have (this.)x += 3; so you would change that to display.x += 3; and leave the stage's position alone.

kkots
kkots
  • Member since: Apr. 16, 2013
  • Offline.
Forum Stats
Supporter
Level 10
Blank Slate
Response to parallax scrolling/stationary stats 2013-12-07 02:52:12 Reply

Try to structure your game's Display List somehow.
For example:

Main Timeline (root)
-->gameInterface
-->-->hpBar
-->-->manaBar
-->-->muteIcon
-->gameContainer
-->-->parallax1
-->-->parallax2
-->-->player
-->-->parallax3
-->-->parallax4

BBS Signature