Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Need help, whit jumping allmost have it just need a bool command.

Author
Message
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 22nd Dec 2008 16:46
hi i am trying to make a jump so i try this code:


and you need this float

j_CameraPositionY = dbCameraPositionY();


but it starts shaking becaus i hold space so i need a way(bool)
that if it has been pressed then you couldnt do it again unless you the its landet or(that j_CameraPositionY > 3.0f)
plis help i realy dont now much about bools.

thnx in advance.

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Dec 2008 19:00
Do you want the camera to come back down to its original position?
or camera stay at 10.
Also, do you want to keep hold of spacebar or press once?
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 22nd Dec 2008 19:25
The camera to go back down.
and when is pressed.

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Dec 2008 19:58 Edited at: 22nd Dec 2008 20:01
Here is a bit of code that will bounce the camera up and down using a bool.

Before loop declare:

Then in loop:
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 22nd Dec 2008 21:20
This goes up....
i am trying to make it like a jump this just goes up.........
i am trying to make if u click space that younwoud go up and down and then if u would click space agein you could jump again help..
pls..

but thnx for this to now i can control the camera in the air

Game.Love
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 22nd Dec 2008 21:46
Somethings wrong whit this i think


This means if its 7.0f height then this should go down, i think but it dosent go.

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Dec 2008 22:31
it worked for me, ill just check it.
it should move the camera up to 10 and down to 0 over and over while space is held down.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Dec 2008 22:38
Yes it definately works but I gather that you just want to press space once and then it will do a full cycle, I'll take another look.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Dec 2008 22:52
try this.
Before loop declare:

Then in loop:
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 23rd Dec 2008 01:11
in pseudo code:

if spacebar is pressed and jumping is 0
{
jumping=1
jump code here
}

if person height == ground height
{
jumping = 0
}
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 23rd Dec 2008 15:16
ok got i working....but then when it returnns to the position
of fheight i can get this working whit

but if i have this it may stay at the level of the terrain but i can jump

pleas help..!!!

Game.Love
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 23rd Dec 2008 16:09
heres a litle video to see what i mean

you can see that it jumps, sometimes i just jump to a position a litle lower thats for the crounch.
the problem is that when i am not jumping(space)that i can move frily around but if i use what i ussed to have i can jump
(
)
pleas help.

Game.Love

Attachments

Login to view attachments
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Dec 2008 16:46
Im not 100% sure what you mean but if you are saying that the camera doesnt return to its initial height, try this:
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 23rd Dec 2008 17:19
if anone got it working could you pls show it to me whit a example like from the terrain example(i need it to work whit the terrain)

plis.!

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Dec 2008 17:45 Edited at: 23rd Dec 2008 17:50
Try this:


Your code is a bit confusing because your using dbMoveCameraUp when you should probably be using j_CameraPositionY++.
Doing it your way you always have two camera heights (real camera and j_CameraPositionY) and they have to constantly update each other.
I would suggest sticking to one or the other then update once.
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 23rd Dec 2008 17:52
nep, its the sain.

i need a way that when space is not pressed that it woud be there.
but not this

wile this code works, I can jump then.(i am Loocked down)
this doe looks wierd i shudnt be locked down becous 0(dbSpaceKey() == 0)
means if its not pressed write??

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Dec 2008 20:05
Dont really understand what your problem is, I may need to see more of your code.
Is it just jumping up and down that your having trouble with?

This isnt very good, there will be a better way.
Im not sure why my example isnt working for you, could you explain?
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 23rd Dec 2008 20:50
When i hold space it jumps off wonderfly but the problem is then i dont have gravity i can fly around(i am not locked to the floow)
now this code works fine for this but then i cant jump

so if u dont understand what i mean, pls, make an exaple(whit gravity and jump) out off and dark gdk example(the terrain example).

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Dec 2008 21:29
O.K I see your problem now, use:

(!jumping) is the same as (jumping==0).
Let me know if you have any more trouble and i'll post the full code.
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 23rd Dec 2008 21:41
thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx, thnx :


it Workes...

u.r.d.best

Game.Love
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 24th Dec 2008 20:32
how can you make that if u press space that it woud create the whole jump, now i have to hold it


Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Dec 2008 13:15
Im confused, this code does perform whole jump without holding space.

Here is the full code.

FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 25th Dec 2008 13:53
ok, works now.
thnx.

Game.Love
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Dec 2008 14:12
Merry Xmas!!!

Login to post a reply

Server time is: 2024-11-25 09:17:38
Your offset time is: 2024-11-25 09:17:38