Alice Community Video Game Concepts Vol. 3: Multi-Terrain Gravity

 View Poll Results: What do you think so far? Looks good. Keep going. 4 100.00% Too specific. 0 0% Not specific enough. 0 0% No more screenshots. 0 0% Keep the screenshots, but smaller next time. 0 0% Stop right there. 0 0% Voters: 4. You may not vote on this poll

 Video Game Concepts Vol. 3: Multi-Terrain Gravity
x2495iiii
Super Moderator

Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Video Game Concepts Vol. 3: Multi-Terrain Gravity - 09-15-2009, 12:34 AM

I was asked to make one about having separate gravity methods for both land and water, so here you go. (Also, some people asked for screenshots, so I'll do my best)

Background: In games where the only objects you can fall on are solid, you only need one type of collision method which has the objects stop when one falls on the other. For water, however, you need to add another method which allows the object to sink, either partially or completely, under the water's surface.

Explanation: When an object falls into water in reality, it sinks at least a little bit no matter it's weight or density. This is another part of the game's physics, as there needs to be a special provision to prevent the object from walking on water or from sinking forever.

Example: In this world, the penguin immediately falls to the island. Both he and the island can be moved and when he is no longer above any part of the island (even the outer edges), he sinks into the water partially and bobs semi-realistically. I even solved the problem which made his feet partially sink into the island in Vol. 2. Key Ideas: First, a method determines if the penguin is above the island or not. Then, another method determines how far down he falls. To solve the problem which let to his feet getting buried, I changed the original method to stop moving him down when he was less than a certain increment (0.04 meters) above the island (or water), then pass it off to another method which moved him down to the island (or water) in zero seconds, making him ultimately move the exact distance to the island (or water) seamlessly. To make the penguin stop midway in the water, another object (I call it a marker) must be added. I used a bump shape, then moved it to the positionI wanted in the penguin,
then it made it's vehicle the penguin and set it's "is Showing" to false. This way, the penguin can easily sink down to any level I choose by setting the marker to whatever level I choose.

Application: Same as normal gravity, new objects must be added to a list to be affect by gravity. The only provision you'd need to make (which I didn't make in this world) is a way for the object to get back on land somehow, as moving the island back over the penguin won't cause him to rise to rise back to the top of it.

EDIT: I figured out how to delete the giant, problematic screenshot, so I'll try to re-post a smaller version next.

EDIT2: I spent a lot o' time on it, and I really can't find a good way to get small but readable screenshots. If anyone knows how, please tell me.
Attached Files
 PeguinGravity.a2w (702.7 KB, 69 views)

(')>

Last edited by x2495iiii; 09-15-2009 at 08:09 PM.

 dubastot Senior Member     Status: Offline Posts: 661 Join Date: Apr 2009 Location: Two Steps From Hell 09-24-2009, 05:30 PM Sorry, I haven't tried your program out yet even though you basically made it for me.I've just been really busy for the past few weeks.
 x2495iiii Super Moderator     Status: Offline Posts: 3,508 Join Date: Dec 2008 Location: Somewhere in the Continental U.S. 09-26-2009, 01:34 AM Don't worry about it, you can get around to it when you get around to it. In the meantime, is there another concept you'd like explored? I was considering making a pseudo-character-customization screen, but something like double-jumping or something sounds fun too. (')>
 dubastot Senior Member     Status: Offline Posts: 661 Join Date: Apr 2009 Location: Two Steps From Hell 09-26-2009, 07:06 PM I think double jumping would be pretty cool too.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge