Best way to track position on a large map?

Get help using Construct 2

Post » Wed May 22, 2013 10:01 pm

Lets say we have a map that is -10,000 x -10,000 to 10,000 x 10,0000 (pixels... or units?)

I'm loading the "map" (level) by sections around the user.. So say the user is standing at 0 x 0, I would load 1000 pixels (units?) in all directions. Then load / remove zones as the user moves.

This being a 2.5 D game, the user can walk up, down, left, and right.

How should I handle the position of the map (level)? Should the user be "moving" and I just track there pixel location? Or should I move the background (and all objects on the background) and just lock the user to the center of the screen? Does it even matter?

I'm very mew to construct, and when you create a new project, you have that white area to present all your stuff (don't know the proper term - maybe stage?). Do I need to make the stage match my map size? or does the stage just need to match what the user can see, and everything else moves?

Just a little lost here...
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 10:31 pm

track the player by pixel that is probobaly the best way
ps.
we'll if your mew to construct your going to need a lot of help
B
39
S
10
G
7
Posts: 514
Reputation: 9,426

Post » Wed May 22, 2013 10:36 pm

@sosensible If I'm tacking the user by Pixel, and the user leaves, and comes back (refreshes page)... do I just move the player to x / y in the viewport then load the map around them?
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 10:40 pm

that sounds like it thould work unless your generating it randomly
ps.
if you did not notice it you said you were """mew""" to construct might want to edit your post
B
39
S
10
G
7
Posts: 514
Reputation: 9,426

Post » Wed May 22, 2013 10:44 pm

@sosensible lol, I did not even notice that..

So that white box when load Construct 2 is called the "view port" right? does that need to be the same size as my map/level?
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 10:53 pm

i'm not quite sure what you mean but if your going to be making games in construct for mobile your going to want to set your view size to scale in the full screen in browser option
B
39
S
10
G
7
Posts: 514
Reputation: 9,426

Post » Wed May 22, 2013 10:55 pm

Is there an article about the whole scale thing?
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 11:23 pm

You tend to centre the camera on the player and scroll the play area to suit, but there are no rules, if you can think of a different approach, then go for it,adding scroll to behavior to the player will keep him central to the screen.

That white box in the editor is your layout, levels tend to be inside these, but you could have a level larger than that, see unbounded scrolling, Your view port is the visible play area at runtime
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Wed May 22, 2013 11:40 pm

@Pixel perfick

So do you suggest I add "scroll" to the player? and then will that allow the player to walk "forever" in any direction? I will add walls on the edges, so i don't have to worry about the user walking outside of the level. I just want to know the "best" way... My first project will allow the user to log off and on so I need to be able to put them back at the last know position.
B
6
Posts: 35
Reputation: 370

Post » Wed May 22, 2013 11:49 pm

Okay, so I added the scroll and set the layout to allow unbound scrolling. That seems to give me unlimited space :-)
B
6
Posts: 35
Reputation: 370

Next

Return to How do I....?

Who is online

Users browsing this forum: gregorysforster, WhosWho and 13 guests