|
Someone make this not look so bad. please. |
Senior Member
Join Date: Oct 2008 Posts: 268 |
If I make 3 different buildings, with 3 different heights. I want the player to die if he jumps from the biggest building. Can I accomplish this easily with beta 3? how? just programming the api, there will be a method or something that says getHeight() if(getHeight() > 10 ) Player.Die(); I would love it |
|||
|
#2 |
|||||
|
Realmware CTO
Join Date: Feb 2008 Posts: 1,485 |
I'd recommend you just use SimpleDynamics for now, which employs gravity and scene Heightmap. Whenever an object "lands" on the ground from a fall, it calls the object's "OnLanded" event handler, where you can check the velocity of the impact. So I'd recommend that you just deliver damage to the avatar as a function of the "Y" velocity (downward) upon landing. Then if the avatar runs out of health, they die (already implemented). |
||||
|
#3 |
|||||
|
Senior Member
Join Date: Oct 2008 Posts: 268 |
nice, I will love it! when I click on an avatar and then click on events, I dont see any events, I guess its available on 3.0 only? thx Last edited by levalencia : 10-22-2008 at 05:04 AM. |
||||
|
#4 |
|||||
|
Realmware CTO
Join Date: Feb 2008 Posts: 1,485 |
The OnLanded handler is a virtual method that gets called by Simple Dynamics, and so there isn't an event to register for, but rather just a method to write. In Beta 3.0, these hard-coded methods will be replaced more flexible events. |
||||
|
#5 |
|||||
|
Senior Member
Join Date: Oct 2008 Posts: 268 |
Najak. I guess I create the method on the script editor, Does it have intellisense? well, lets suppose I created the method something like public void DecreaseHealth(Player p, Vector2 velocity) now how do I execute this method on the Onlanded event? Last edited by levalencia : 10-22-2008 at 09:07 PM. |
||||
|
#6 |
|||
|
Realmware CTO
Join Date: Feb 2008 Posts: 1,485 |
For Beta 2.4 you can either define an "OnLanded" command/activity for the avatar, or you can just override the "OnLanded(..)" method in the Avatar class, and call your code from there. So right now, it *does* act as both a hard-coded override as well as an event called "OnLanded". |
||
love
Can not see it...
The webpage's format is kind of mess.
I have added summary of this
I have added summary of this response under the new Gameplay Programming FAQ page, and will delete this page.