Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,209 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
help #298303
11/13/09 17:37
11/13/09 17:37
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
how can i jump with a simple code in a 3d plataform game? i've tried the aum 79 but i couldnt make it work, (no animation, just a block model)

Re: help [Re: Funeral] #298516
11/15/09 17:54
11/15/09 17:54
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
The basic idea is that when you push a button it needs to increase the Z of the entity. To practice just have it move the charter's Z position while the key is pressed. Use no Gravity in this experiment. Then have it decrease the Z as gravity normally would an use collision detection.

While I've not looked at AUM 79 one problem you might have is that your character could be so big that the bit that is jumping by could nothing for that size. Try increasing the amount you jump by.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: help [Re: FoxHound] #298573
11/16/09 03:51
11/16/09 03:51
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline
Newbie
Sepiantum  Offline
Newbie
S

Joined: Nov 2009
Posts: 34
var gravity = 9.8;
var jump = 0;
var mumpspeed = 5;

function main(){
while(1){
if(key_cuu && player hitting platform){
jump = 1;
}
else if(player hitting platform){
jump = 0;
}

if(jump){
player.z += jumpspeed;
}

player.z -= jumpspeed;
}
}

It should be along the lines of that. Look at it, experiment, and modify to fit your uses.

Re: help [Re: FoxHound] #298702
11/17/09 02:02
11/17/09 02:02
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
thats very simple, i have some experience on that, the problem is to make the z to decrease after the character has areached a certain altitude...
and no problem with the character size, its just the guard model that comes with the 3dg

Re: help [Re: Funeral] #298819
11/18/09 08:17
11/18/09 08:17
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Think of how gravity works. When you jump gravity doesn't stop, it is simply overwhelmed by the amount of force you used to push yourself off the ground, however it is still acting on you, slowing you down until you stop moving upwards. For a fraction of a second you are actually still in the air. Then you start to come down as only gravity is acting on you.

You will need to do a lot of similar thinking when you program.

So a good way is to set an "up" movement on you Z and have the gravity subtract from it. A good way to do that is set one of the skills as the gravity and have it pull the player down all the time and have a function check on it's gravity and if it gets to high thanks to the jump have it lower it slowly until you get back to the correct negative z.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: help [Re: FoxHound] #298895
11/18/09 20:51
11/18/09 20:51
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
i set the gravity by adding -2 at the c_move instruction and it works fine. the problem is when i do "if(key...) my.z +..."
the player keeps going upwards till i release the key, and if i use "on_key... = jump" it jumps but it doesnt wait until the player touches the floor, and i want it to be able to jump only when its on the floor, not when its in the air.

Re: help [Re: Funeral] #298900
11/18/09 22:11
11/18/09 22:11
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Check what I said about the gravity var. Set a skill for your gravity and use that in your c_move. Again, you add this number once.

Now you'll need another var or bool or whatever. When you push the space bar check to see if that var is true. If it is not then set it to true and do the jump. When that number reaches negative 2 or whatever have the bool set to false.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1