Page 3 of 3

Re: T35Tbot thread

PostPosted: Mon Oct 17, 2011 10:11 am
by Kalladdolf
Heh, after my tests on the iPod I had to learn (unfortunately) that even having multiple buttons pressed has its flaws (pretty serious ones which often screwed up the control flow).
I was using Mouse Enter / Leave and Mouse Button Down / Up events.
Altogether I had 4 buttons: A left, right (left side of screen) and up, down (right side of the screen).
Making a player run and jump at the same time didn't work as expected.
Reason: Game Editor does indeed use the one mouse coordinate it has for tracking the events above.
The mouse coordinates are located where a touch last moved.
So let's say I touched point A and point B at the same time, the coordinate would only be at one point. If I moved A, it would be at A and vice versa.
Let's assume I had two different buttons located at A and B (run right / jump).
I'm running to the right and pressing the jump button. The player jumps.
Accidentally I move the finger on the right run button for 1 pixel (which is the most likely thing to happen anyway) and at the same time let go of the jump button.
The coordinates jump right to the right run button without registering a Mouse Leave or Mouse Button Up event. Control [4] ( control array; 4 = jump) is still active and the player
will keep jumping until I push the button again (without touching anything else) and move the finger off it or let go.

Tldr:
The issue is about letting a button go. A Mouse Leave / Mouse Button Up is not called when at the same time a finger on another button is moved.
That way my player e.g. keeps running forever until he hits a wall / he dies / I press the directional button again and release it.

Re: T35Tbot thread

PostPosted: Mon Oct 17, 2011 10:17 am
by skydereign
Yeah, using mouse enter and mouse leave events won't work due to the one mouse. I have however made a game using a decent level of multitouch, but it all depends on the way you want your controls to work. What I had was a joystick like control for movement or aiming, and then buttons, like jump. Of course you can't have hold buttons, but I used switch buttons when I needed that.

Re: T35Tbot thread

PostPosted: Mon Oct 17, 2011 6:44 pm
by Hblade
Kalladdolf:
If you want to make your player acutally collide INTO the ground rather than on the top pixel, you can make a collision box then place him under the box ^^ This will make it look more like he's actually on the ground. The collision box will handle all the collisions, just make the player's parrent the box.

Re: T35Tbot thread

PostPosted: Mon Oct 17, 2011 7:03 pm
by Kalladdolf
I'm using filled regions, yes. That way I can more accurately determine positions.
In fact, the only collision detection is done when the actor touches the platform once, from there everything is handled by position detection and if() clauses.

Re: T35Tbot thread

PostPosted: Tue Nov 01, 2011 9:04 pm
by JamesLeonardo32
Wow, how did i miss this game?
Kalladdolf, your the next supreme BeeAnt!

Re: T35Tbot thread

PostPosted: Tue Nov 01, 2011 9:22 pm
by Hblade
This is awesome :D :D!

btw kal: Try instead to use a collision mass similar to GAG's in his mario demo, it works best.
viewtopic.php?f=6&t=9992&hilit=Perfect+collision

Re: T35Tbot thread

PostPosted: Thu Nov 03, 2011 6:04 pm
by Kalladdolf
Thanks for the advice Hblade, but I already tested that collision engine on my iDevice during my research on engines, but it lagged.
That's mainly because of permanent collision tracking.
The one I've got at the moment is almost lagless. :3