Blobby aKa the new mario

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Re: Blobby aKa the new mario

Post by cjgone »

I'm assuming they want this: y=Vo*t + 1/2 at^2, where y is distance it travels up, Vo = initial vertical velocity, a = gravity or 9.8 m/s^2 and t for time.

Basically you need to figure out what you want your initial velocity to be, or how fast you want to throw it upwards. That will allow you to figure out how high it will go and the time it takes for you to throw it up and for it to fall down to the ground.

Now, once you have the time, all you need to do is have a separate velocity, or horizontal velocity, to determine how much you want it to travel forward.
Example of have to use this equation please using 9.8 m\s\s would be appreciated.

Probably gonna precalculate the values then do what driesgrudolf said or whatever his user is. ;o
User avatar
calc84maniac
Regular Member
Posts: 112
Joined: Wed 18 Oct, 2006 7:34 pm
Location: The ex-planet Pluto
Contact:

Re: Blobby aKa the new mario

Post by calc84maniac »

What I do in my Mario game is:
a) Have an x and y velocity for each object
b) Each frame, add the x velocity to the x position and the y velocity to the y position
c) Each frame, also add a gravity value to the y velocity
d) Also handle the x velocity in each frame depending on what arrow keys are pressed, which allows for "sliding"
~calc84maniac has spoken.

Projects:
F-Zero 83+
Project M (Super Mario for 83+)
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Re: Blobby aKa the new mario

Post by driesguldolf »

cjgone wrote:
-snip-
Example of have to use this equation please using 9.8 m\s\s would be appreciated.

Probably gonna precalculate the values then do what driesgrudolf said or whatever his user is. ;o
That is exactly how it works, however the 9.8 m/s probably won't work very well (since you don't want 'real' jumps, and mario usually jumps rather high). In your simulation the meters are pixels and seconds are frames.

Mine was just a worked out example of the actual theory behind it (as ISUCK explained).
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Re: Blobby aKa the new mario

Post by cjgone »

awesomenessssss

Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Re: Blobby aKa the new mario

Post by tr1p1ea »

WOW! Looking fantastic cjgone! Its basically almost complete by the looks of things, at least it would be very playable if you were to release it now.

As far as physics is concerned, you dont need to use constant accel equations or any other worldy physics formulas. Simple addition of your acceleration is sufficient, sort of like:

Acceleration = Constant
Velocity = Velocity + Acceleration
Position = Position + Velocity

To make something 'jump' just set 'Velocity' to -10 or something, and maybe an acceleartaion of 2. You will have to play around with these values.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Re: Blobby aKa the new mario

Post by cjgone »

Thanks. I'm planning to add "physics" to up and down.


I already use speeding up for left\right in the screeny using the velocity \ acceleration add method -- a bit choppy since it's either like 1 \ 2 \ 3 pixels, but i'm pretty lazy heh. I'm also using lists of x and y residuals to give things like throwing veggies and crap more of a "natural" throw (already implemented in the particles to give them a more realistic fall). Unfortunately, can't do that with some objects that interact with the tile maps, because of a lame limitation I coded.

Score system , I still gotta plan that out since it's a bit tougher then I expected, again due to a coding limitation (the score you get from killing crap is an object that's pretty much a discrete unit, so 20 isn't 20, it's jsut a pic of 20 and cannot become 30 atm.. My engine doesn't allow for special objects atm, so i'm trying to find another way). :(

Some more bugs to be fixed when I get some time. :D and i'm gonna art crazy and make like a gazzilion bitmap pics to give the game abetter look, since it still appears a bit bleak atm. (not to mention my XOR drawing, which I need to find an AND\OR clipping routine.)
Post Reply