How do I scrollto in a limited area

Get help using Construct 2

Post » Thu May 12, 2016 12:45 pm

Hi,
I have 2 players with joystick.
I wish to use a scroll to behavior for player1 in a limited area and the same for player 2 in another limited area.
Can you help me ?
Best regards from France
B
28
S
13
G
8
Posts: 15
Reputation: 6,112

Post » Thu May 12, 2016 1:18 pm

Could you please elaborate more what do you mean by limited area?

On the basic, any object with scrollto behavior will have the camera centered on. If two objects have scrollto behavior, the camera will be centered at the midpoint between the two objects. However, if these objects are so far apart, you won't be seeing these objects.

Personally, I would prefer to have only one Camera object and control everything myself with events. But before we could help you validly, could you please elaborate more about your game? This is so we could help you validly.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Thu May 12, 2016 2:01 pm

HI,
Here is a picture
Image
It's a face to face game. The player 1 must scroll to into the pink zone only and the player 2 in the blue zone independantly when each player use the joystick ( little circle). Do you think i can use the scrollto behavior to do this. thank you
B
28
S
13
G
8
Posts: 15
Reputation: 6,112

Post » Thu May 12, 2016 2:31 pm

In that case, scrollto behavior is not what you are looking for. ScrollTo is for camera.

What you want to use is probably Bullet behavior, and then use events to limit the players to their areas.

One possible way (not the best way but an easy one) is:

if player1.x > LayoutWidth / 2
player1.x = LayoutWidth / 2
if player2.x < LayoutWidth / 2
player2.x = LayoutWidth / 2

This will make player 1 not able to move to the right half of the screen and make player 2 not able to move to the left half of the screen.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Thu May 12, 2016 3:15 pm

Thanks ! I will do my best !
B
28
S
13
G
8
Posts: 15
Reputation: 6,112


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 12 guests