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.

Newcomers DBPro Corner / Struggling with Jumping timer

Author
Message
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 11th Mar 2012 20:48 Edited at: 11th Mar 2012 20:54
Just trying to make a small jump timer so that the character cannot jump round like a lunatic and requires at least 1 second or so rest before the spacebar will have an effect on the characters jumping.

This is the unrunable jump code.


And my global variables to do with all this are as follows



I think i am putting something as a float that i shouldnt be, or something as an integer that shouldnt be, but i have tried everything swapped around and come up with nothing.
It seems to do 2 things that annoy the living p*ss out of me.

1) Does not like Dec for decreasing values properly even though i know this works as i have used it hundreds of times for floats and integers.

2) Shockingly poor inaccurate float values. I have a few bits of text telling me what some of the values are and for example i have the jump_timer set to 1. It does not go to 1 but instead chooses a value just a little under 1, this of course knocks a few things out of wack and is why i have lots of things in that code that say if a value is not 0 then make it 0 even though it probably should be.

So after taking a step back and then re-writing it, then taking a nother step back i cant figure out a good method to make a char jump, then not be able to jump for a split second or so before jumping again i think i will throw this out there and see what suggestions i get as i dont mind re-writing it out and getting a better knowledge of what is happening when the variables are being changed. As things are happening so fast its difficult to catch them.

Thanks in advance.


For anyone who is interested i am doing my own sort of version of learning from one of Ruccas's fps tutorials and my full code so far can be found here.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 12th Mar 2012 03:40
That's a really old tut. I edited it and moved the camera back a little so you can see the player. It jumps and waits a bit and jumps again if you hold down on the SPACEBAR.



You should be able to go through to see the changes I made. Hope this is helpful.

So many games to code.......so little time.

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 12th Mar 2012 09:58
Thank you so much for taking a look at that for me. I can see that working now. Is it because i am delaring floats and just using whole numbers like 4 instead of 4.0; and that is why i am getting terribly inaccurate numbers everywhere?

Also it is an old tutorial ill agree, it is unfortunately very unfinished as well, as 90% of the good tutorials i have come across are, so when i have gone through this i am going to look at possibly asking someone to help me expand this into something finshed so everyone can use it.

Its one of my biggest pet hates of DBpro; everyones tutorial starts off amazing and exciting then fades off into unfinished chapters once it gets good.

Once again, thank you for your help.
Ramon156
13
Years of Service
User Offline
Joined: 13th Jul 2011
Location: Netherlands
Posted: 12th Mar 2012 11:10
Hi Somarl, There's also a JumpTimer in the Sparkys DLL example on this page.
http://forum.thegamecreators.com/?m=forum_view&t=114275&b=7
At step 6

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 12th Mar 2012 16:15
Quote: "Its one of my biggest pet hates of DBpro; everyones tutorial starts off amazing and exciting then fades off into unfinished chapters once it gets good."


TBH, I never liked that tutorial, because it simply demonstrates some basic things, but it is far from helping someone make actually make a FPS.

Quote: "....so when i have gone through this i am going to look at possibly asking someone to help me expand this into something finshed so everyone can use it."


Okay, do you have a plan for a game in mind?

So many games to code.......so little time.

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 12th Mar 2012 19:13
Quote: "Okay, do you have a plan for a game in mind?"


Yes i do. I have been currently planning for a very long time but only recently (last 6 months or so) have i begun to cut it down. I have decided that the game i want to make so far cannot be made easily so i would merely like to make the concept of it. For example there are far too many assets for me to handle and i am a terrible artist anyway so all i can do is the best i can.

What i want to do in the not too distant future once i have nailed down a few more concpets (A* pathfinding, collision, etc) is go through the game i want to make peice by peice as a sort of "learn on the go" tutorial, where basically i start with what i need to start with and ask for help as i go along. If i can understand it then anyone will be able to as i ask all the questions i need to get to the next stage in the tutorial. Once i have a little concept of the FPS part of the game nailed down i will trim the fat of the posts and try to pop it into a PDF so other folk in the community might have a working FPS to learn from start to finish with at least all the basic principles covered because if im honest thats what i think the forums are lacking.

Forgive the long post. More will follow when i understand a few more things and then write up my "chapter list" of all the things that need to go into the fps to make it work. Then project 'Somarl' will go ahead

Login to post a reply

Server time is: 2024-11-22 04:24:57
Your offset time is: 2024-11-22 04:24:57