ID:163274
Sep 16 2007, 9:10 am
|
|
I'm thinking of creating a multiplayer platformer, but haven't the slightest clue on how to do jumping (or gravity). Could I have some help here?
|
Sep 16 2007, 9:18 am
|
|
If you look a couple topics down then you'll see someone asking the same question. But anyway you can search for it through the Forum Search or look for one of multiple demos that deal with gravity/jumping.Here's an example but I forget where I found it....
|
In response to Monkeykid0049
|
|
Yeah, that's what I did, thanks, and I found that one.
|
In response to Monkeykid0049
|
|
That will work, but only for mobs with clients.
Here is what I'd do: mob |
I don't think the solutions I've seen so far are really that appropriate for the BYOND platform. That is, they tend not to be efficient enough and gravity runs all the time, not to mention they don't incorporate everything you'd like (such as only density checking when they should be calling turf.Enter()).
client I like to do something like that. What I said before is not to say that they don't work, they just probably aren't ideal for BYOND. It becomes an even greater problem when people decide to use pixel movement for their side-scroller, which will probably only look good if plsyed in single-player. |
In response to CaptFalcon33035
|
|
Personally, I think running gravity all the time is better on the far-end than intensively checking if you're supposed to fall when you move, not to mention you'd also need to recheck that for every surrounding object when you need to delete or move something(e.g. a player logging out, letting the player that jumped on him before he logged out stay in the middle of the air). That's just my opinion, though.
|
In response to CaptFalcon33035
|
|
It's better to use recursion than a while loop. Also, if someone were standing under the player then walked out of under them, they wouldn't fall.
|
In response to Zaltron
|
|
Aye, you are right--I hadn't thought about that. It's a quick-fix anyway. Just out of curiosity, though, why would recursive be better? I've always preferred iterative in this situations, just because it doesn't screw up the stack and there is less of a chance of Dream Seeker spitting out a infinite-loop runtime.
|
In response to DivineO'peanut
|
|
In response to CaptFalcon33035
|
|
I suggest recursion mostly because of the infinite loop. Your thing probably wouldn't get the chance to be considered an infinite loop.
|
In response to GrimmJore
|
|
GrimmJore wrote:
you guys coders A good place to ask for programmers is under the classified ads section. http://developer.byond.com/forum/ index.cgi?action=message_list&forum=6 |
In response to Zaltron
|
|
Exactly, which is just what I'd like it to do. Move() will stop returning true at some point and just in case it's a very long time, I don't want it to abuse (and possibly overload if that's possible in DM) the procedure stack. I've always liked the iterative approach, and if I can help it, I will always use the iterative approach.
|
In response to CaptFalcon33035
|
|
I think its possible to overload the procedural stack... I believe I used to do it, when I first learned about recursion. I used it for a timer and the timer ended somewhere a little after 1000, so the limit is probably around 1000+a little.
|