T35Tbot thread

Talk about making games.

Re: T35Tbot thread

Postby Kalladdolf » Mon Oct 17, 2011 10:11 am

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.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: T35Tbot thread

Postby skydereign » Mon Oct 17, 2011 10:17 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: T35Tbot thread

Postby Hblade » Mon Oct 17, 2011 6:44 pm

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.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: T35Tbot thread

Postby Kalladdolf » Mon Oct 17, 2011 7:03 pm

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.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: T35Tbot thread

Postby JamesLeonardo32 » Tue Nov 01, 2011 9:04 pm

Wow, how did i miss this game?
Kalladdolf, your the next supreme BeeAnt!
JamesLeonardo32
 
Posts: 320
Joined: Wed Oct 13, 2010 4:57 pm
Score: 36 Give a positive score

Re: T35Tbot thread

Postby Hblade » Tue Nov 01, 2011 9:22 pm

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
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: T35Tbot thread

Postby Kalladdolf » Thu Nov 03, 2011 6:04 pm

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
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest