How do I create a layout with multiple gravities

Get help using Construct 2

Post » Fri Apr 25, 2014 4:04 am

Hi,

How do i create a layout which has two gravities in the scene. Like, the screen has been spliced into two half. And the top half has a normal gravity, where objects falls down. And the bottom half has reverse gravity where the objects moves towards up.

Thanks in advance
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Fri Apr 25, 2014 2:43 pm

You can create a placeholder Gravity setter object (and set it invisible). This object could be an ordinary Sprite. In Event Sheet, when your player or enemy collides with it, you change "angle of gravity" of your platform behavior.

If you need more help, just say so.
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 » Fri Apr 25, 2014 4:57 pm

Definitely need help. I am new to construct so do need more help like a demo similar file or step instructions.

Thanks a lot for asking itself.....
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Sat Apr 26, 2014 4:30 am

Here is the capx: http://www.mediafire.com/download/r5dbckk56xjccb6/gravityExample.capx

Inside the capx contains these objects:
Image

The black solid floor/ceiling are the same object.
The stickman is the player, having Platformer behavior.
The arrows are just 2 different sprites for Gravity Up and Gravity Down.

Now, in event sheet:
Image

When player collides with Gravity Up arrow, he will be flipped and his angle of gravity will be set to -90, causing him to have reverse gravity. The same applies for the Gravity Down, but it sets him back to original gravity.

Angle of Gravity is one of the attributes in events of Platformer behavior. Only objects with Platformer behavior will have this Angle of Gravity listed.

Try run the capx.

Are you ok now? ;)
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 » Sat Apr 26, 2014 6:48 am

Hi there,

I got your demo file and thanx for that. Quite interesting.

Check this attached rough image.The green is the land (which is for both the top and bottom worlds). The character should able to walk on the green and when it falls down on the right edge, it will go to the bottom world where it flips and walks upside down there.To do this, is that the same procedure to follow. Because you have used a sprite which allows the character to go upside down when reach near.

How does this works (When a character falls down on the right side (Where the arrows goes), it should fall like it is falling inside the water. Goes bit down comes back up flipped.

Help and thanx
You do not have the required permissions to view the files attached to this post.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Sat Apr 26, 2014 8:51 am

What you want required no more events from my capx.

From my capx, how about you stretch the "down arrow" to fill the upper half of your screen, and stretch the "up arrow" to fill the lower half? ;)

Now, place the solid in the middle, and voila, you will have what you want in no time.

This way, we won't be dealing with line of gravity, and you can specify directly which area should be up or down by placing and stretching these gravity arrows. Additionally, you can turn these arrows invisible for aesthetics purpose.
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 » Sat Apr 26, 2014 9:57 am

Thanks a lot.
Image
B
31
S
7
Posts: 197
Reputation: 2,497


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 61 guests