Skip to main content


Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Eggbertx

Ah, alright. I figured that would be the case. [size=78%]XML does seem a bit more complex than it needs to be, as far as things like configuration, but I've seen several applications that use it anyway.[/size]
Hi all, it's been a while. I haven't been working with Sphere much, but I've still been doing plenty of programming, and I have a question that I've been thinking about for a while. Would you say it's better to use XML or JSON for transferring configuration info, for example, via AJAX. JSON seems a bit more straightforward and easy to use, but XML seems to be more widely used.

also, this might be worth checking out, if you need a very compressed serialization format.
Script Support / Re: (more) 2D platformer issues

When a character hits the ground is one of the trickiest parts of gravity.

Can you describe the process you use to check for obstructions? I'll have a look at the code, but (in my experience) it's hard to figure out these kinds problems without a lot of careful reasoning and even more trial and error.

So I've noticed :/
For obstructions, it just calls Sphere's IsPersonObstructed()

You calculate fall speed going down and check a 'ground line'. Say it's in pixels. If you are falling down at 6.345 pixels (fairly fast), check if it crosses the ground line. So,

Ah, so should I create a function then to, given X, find the Y position of the ground, as opposed to relying on Sphere's obstruction checking?

Code: (js) [Select]

if (IsPersonObstructed(name, player.x, player.y+6.345)) {
  player.y = ground_line;

Try it out with a constant value first (all tiles on platform are the same height).

That's a little bit like what it already does, though I was hoping I could have it so that platforms don't necesarily have to be completely flat, i.e. you could have a sloped or uneven platform. I guess I could use this method still, as long as it also checks where ground_line is at every frame.
Script Support / (more) 2D platformer issues
Hello everyone. I'm still trying to make a 2D platformer, and while I've made a fair bit of progress on it, I'm still running into issues with gravity and ground detection. When you jump, the character goes up, and falls back down, but when it reaches the ground, instead of stopping, it goes down into the ground for about half a second before the "burying" prevention kicks in and pushes it out of the ground. Height seems to have nothing to do with it, since if you walk off a ledge without jumping, it hits the ground as expected. The problem exists somewhere in scripts/SideScrollingEngine/base.js, in Character.update(), Character.gravityCheck(), Character.moveCheck(), or Character.onGround(), but I've been unable to find the exact cause. Any ideas?
You can download the game here
Game Development / Re: The Screenshot Thread

It's all Majestic all the way.

So Majestic has built-in tools for designing a platformer now? Considering my platformer is still having collision issues, I might mess with that, finally.
Sphere General / Re: embedding sphere into a browser

Not currently. Eggbert had a way of downloading games to play on your computer, but it was by no means an embedded Sphere engine. I was going to do this but never got around to it.

JavaSphere was originally intended to use Rhino to play Sphere games in the browser, with all of Sphere's functiosn emulated in Java. When that turned out to be way too difficult at the time (I could probably pull it off now, but I don't have the time and I admittedly haven't even been working with Sphere much lately) I turned it into the downloader, which was still pretty buggy. And the site it was on is down anyway.
Spherical News / Re: Welcome Back!!!

It is a little odd to see us all labelled as 'Newbie's, though. Oh well.

That it does, heh. Looks like the playing field has been leveled, Fight Club style :P