1
Old Bugs (1.x/2.x) / Re: Simulate key release sometimes not happening
« on: May 04, 2012, 10:56:12 am »
Hmmm. That might actually explain it! It seems like maybe both of the iOS "release" blocks don't work so great - but it also seems that "touch is 'released'" works better/more reliably than "'release' 'self'" - which I have yet to get to work at all.
Which sucks, since I would like to use "release self, as I need multi touch controls.
At the end of the day, I've hacked together something that works fine in iOS, but i don't entirely understand how/why some things I've done worked, and others didn't.
I'm building a platformer with a dpad so there's a few different buttons, and they all do slightly different things in different ways. (Jump, shoot, left and right)
Jump and Shoot rely less on a release of a button, and they're the ones that seem to work more wonkily. Right now, jump once works fine, but sometimes doesn't double/air jump like it should - and for some reason my shoot button only works in iOS (which is weird)
When I press right and left, it works great in flash, but in iOS moves at like 1/4 speed - extra slowly.
I built a different, simpler behaviour that works perfectly for left and right, but for some reason, it won't let the key controls work in flash. Now that I'm looking at it, I left off a "release" block altogether, which probably explains why it works better.
It's just this (essentially):
If is touching self:
set game attribute: "control" to true
otherwise:
set game attribute "control to false
if "control" = true
simulate control press
if control = false
simulate control release
Which sucks, since I would like to use "release self, as I need multi touch controls.
At the end of the day, I've hacked together something that works fine in iOS, but i don't entirely understand how/why some things I've done worked, and others didn't.
I'm building a platformer with a dpad so there's a few different buttons, and they all do slightly different things in different ways. (Jump, shoot, left and right)
Jump and Shoot rely less on a release of a button, and they're the ones that seem to work more wonkily. Right now, jump once works fine, but sometimes doesn't double/air jump like it should - and for some reason my shoot button only works in iOS (which is weird)
When I press right and left, it works great in flash, but in iOS moves at like 1/4 speed - extra slowly.
I built a different, simpler behaviour that works perfectly for left and right, but for some reason, it won't let the key controls work in flash. Now that I'm looking at it, I left off a "release" block altogether, which probably explains why it works better.
It's just this (essentially):
If is touching self:
set game attribute: "control" to true
otherwise:
set game attribute "control to false
if "control" = true
simulate control press
if control = false
simulate control release