CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 105 users online: 4 members, 71 guests and 30 bots.
Members: gudenau, LuxenD, ti83head.
Bots: Spinn3r (2), MSN/Bing (1), Magpie Crawler (4), VoilaBot (2), Yahoo! Slurp (1), Googlebot (2), Googlebot (18).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
_player1537


Guru-in-Training


Joined: 25 Nov 2009
Posts: 2957

Posted: 15 Dec 2009 11:31:24 pm    Post subject: jumping

Does anyone know a good jumping routine, like one that will cause the character to jump up in the air and come down, and not one of those where its moves up 2 then down 2. One that looks like real gravity is in place. I'm not sure what I'll use this for, but I think it might be a mario game.
_________________
http://tanner.myserverathome.com
Back to top
TsukasaZX


Corallian


Joined: 13 Mar 2007
Posts: 1226
Location: P4X-650

Posted: 15 Dec 2009 11:37:11 pm    Post subject:

I have a matrix based "physics" routine made by BuilderBoy but it's designed to be used with xLIB and 8x8 pixel sprites. Would that be of any help?
_________________
On EFNet IRC: Whenever | Nick: Su-Hime | Channels: #Cemetech, #UnSS
TI-83+/84+ Projects
Yumé 2: Rika's Story - 25% Complete; Will finish to coincide with Y:tED
PC Projects
Yumé: The Eternal Dreams - rewriting environment system again
TIBiC/GO - 1%; compiling list of commands

"Alenda lux ubi orta libertas" - Let learning be cherished where liberty has arisen.
"Aut viam inveniam aut faciam" - Either I shall find a way, or I shall make one. - Hannibal
Back to top
_player1537


Guru-in-Training


Joined: 25 Nov 2009
Posts: 2957

Posted: 15 Dec 2009 11:38:35 pm    Post subject:

Yes it would. I believe I will be using xlib eventually in the program anyways Smile
_________________
http://tanner.myserverathome.com
Back to top
TsukasaZX


Corallian


Joined: 13 Mar 2007
Posts: 1226
Location: P4X-650

Posted: 15 Dec 2009 11:48:49 pm    Post subject:

M'kay, I'll extract the basic code from my half-completed engine and post it up tomorrow. Smile
_________________
On EFNet IRC: Whenever | Nick: Su-Hime | Channels: #Cemetech, #UnSS
TI-83+/84+ Projects
Yumé 2: Rika's Story - 25% Complete; Will finish to coincide with Y:tED
PC Projects
Yumé: The Eternal Dreams - rewriting environment system again
TIBiC/GO - 1%; compiling list of commands

"Alenda lux ubi orta libertas" - Let learning be cherished where liberty has arisen.
"Aut viam inveniam aut faciam" - Either I shall find a way, or I shall make one. - Hannibal
Back to top
_player1537


Guru-in-Training


Joined: 25 Nov 2009
Posts: 2957

Posted: 15 Dec 2009 11:50:44 pm    Post subject:

Thank you, I look forward to seeing the program. All the gravity simulators I have made always look really blocky, or just doesn't match actual physics in any way Sad oh well. Do you know what variables it uses so that I can begin working on it?
_________________
http://tanner.myserverathome.com
Back to top
TsukasaZX


Corallian


Joined: 13 Mar 2007
Posts: 1226
Location: P4X-650

Posted: 16 Dec 2009 12:04:36 am    Post subject:

It needs like 5 variables minimum (although I can only remember the reason for 4 of them). Well.. less if you have very non-dynamic sprites Razz

If you mean what are the variables I use, well then: X, Z, E, D, and K (0x5 random variables and yes I know you shouldn't use X or Y but my engine is a WIP engine).

If I'm still not understanding and answering your question then ... it's 10 at night. I'm too tired to think Laughing
_________________
On EFNet IRC: Whenever | Nick: Su-Hime | Channels: #Cemetech, #UnSS
TI-83+/84+ Projects
Yumé 2: Rika's Story - 25% Complete; Will finish to coincide with Y:tED
PC Projects
Yumé: The Eternal Dreams - rewriting environment system again
TIBiC/GO - 1%; compiling list of commands

"Alenda lux ubi orta libertas" - Let learning be cherished where liberty has arisen.
"Aut viam inveniam aut faciam" - Either I shall find a way, or I shall make one. - Hannibal
Back to top
_player1537


Guru-in-Training


Joined: 25 Nov 2009
Posts: 2957

Posted: 16 Dec 2009 12:09:09 am    Post subject:

could one of the variables be the xor, and, or part? Also what does "0x5" mean, I have seen it on many forums on cemetech and wasn't sure.
_________________
http://tanner.myserverathome.com
Back to top
Eeems


Super-Expert


Joined: 22 Jan 2009
Posts: 832
Location: Edmonton, Alberta

Posted: 16 Dec 2009 12:11:12 am    Post subject:

0x5 is the auto correct of l o l (without the spaces)
I don't quite remember why though...
_________________
Back to top
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 8189

Posted: 16 Dec 2009 12:15:03 am    Post subject:

They look blocky because you are working with a crappy screen.

As for jumping, just use the real physics. A jump is simply a falling body that starts with an initial upward velocity. So give your character some initial velocity, then repeatedly add the acceleration due to gravity (-9.8m/s^2) until the characters resulting position is back at where he started.

Or if you haven't taken any high school physics classes, here is an algorithm you can copy - since that is probably what you really want. Not to learn and research, just to copy/paste. I know this because you didn't just google for how to do this, you bugged all of us with a really basic question: http://www.gamedev.net/community/forums/topic.asp?topic_id=490713

As for 0x5 being lol, its a geeky joke Kerm took way too far.
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
TsukasaZX


Corallian


Joined: 13 Mar 2007
Posts: 1226
Location: P4X-650

Posted: 16 Dec 2009 12:16:47 am    Post subject:

_player1537 wrote:
could one of the variables be the xor, and, or part? Also what does "0x5" mean, I have seen it on many forums on cemetech and wasn't sure.


Variables (I remember now Laughing ): One is for the X location on the graph screen, one is for the Y location, one is for the bytes-from-left on the source pic (used for alternating sprites for walking), one is for horizontal flip, and one is for the xLIB getkey
_________________
On EFNet IRC: Whenever | Nick: Su-Hime | Channels: #Cemetech, #UnSS
TI-83+/84+ Projects
Yumé 2: Rika's Story - 25% Complete; Will finish to coincide with Y:tED
PC Projects
Yumé: The Eternal Dreams - rewriting environment system again
TIBiC/GO - 1%; compiling list of commands

"Alenda lux ubi orta libertas" - Let learning be cherished where liberty has arisen.
"Aut viam inveniam aut faciam" - Either I shall find a way, or I shall make one. - Hannibal
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55742
Location: Earth, Sol, Milky Way

Posted: 16 Dec 2009 12:27:35 am    Post subject:

Yup, I was going to say that you need an (X,Y) location for the player, a (Vx,Vy), and an (Ax,Ay). Ax should be some coefficient of friction if you want friction surfaces, and Ay is of course -9.81m/s^2 (of -32ft/s^2).
_________________


Back to top
rthprog


Expert


Joined: 21 Sep 2007
Posts: 726
Location: Pittsburgh, PA

Posted: 16 Dec 2009 09:10:20 am    Post subject:

KermMartian wrote:
Yup, I was going to say that you need an (X,Y) location for the player, a (Vx,Vy), and an (Ax,Ay). Ax should be some coefficient of friction if you want friction surfaces, and Ay is of course -9.81m/s^2 (of -32ft/s^2).


wait, is this character jumping just straight up and down, or also forwards/backwards and off odd surfaces?

For straight up/down, the simplest solution would be just to specify an intial velocity (upwards, such as 5 pixels/frame), and subtract one or more pixels each frame until the player hits the ground again.

If you want the character to bounce, then just subtract one or more pixels from each frame each bounce.

Sure, it might not be completely accurate, but it'll look good, and for smaller jumps, it'll be fine.
Back to top
shmibs


Advanced Member


Joined: 25 Nov 2009
Posts: 230

Posted: 17 Dec 2009 08:41:35 pm    Post subject:

i remember making some jumping engines way back when(ah the good old days...)
it's really not that difficult; you should just try to figure it out yourself before asking people.

Quote:
As for jumping, just use the real physics. A jump is simply a falling body that starts with an initial upward velocity. So give your character some initial velocity, then repeatedly add the acceleration due to gravity (-9.8m/s^2) until the characters resulting position is back at where he started.


to make this a little simpler: take your character sprite and estimate what his height would be in meters were he full-sized. then use the ratio of the characters estimated height in meters to his actual height in pixels to find the total number of pixels-per-meter (spr pixels/spr meters=x/1. solve by cross-multiplying). then find the number of pixels in ten(approximation) meters and make that the rate of change for your Y-acceleration variable
...or you could just guesstimate(i doubt anyone will know the difference, seeing how small the screen is). then just use a matrix for collision data and you're set!
oh, and friction is really unnecessary if you're writing in basic
_________________

ohithur
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.033621 seconds.