Hey guys! Just thought I pry your brains about using rawtouch. This is my first time stepping outside the pointer commands and Im not happy with the way it has turned out.
so my screen (1024x768) is going to be split along the X at 512. If the player touches the left side the sprite runs left, and if the player touches the right side the sprite runs right. If the player taps both sides at the same time, I would like for him to turn into a cannon in place.
As of now, I am using the following command for navigation
function moveplayer()
//print(GetSpritePhysicsVelocityX(main.spr))
if GetPointerState() = 1
if GetPointerX() < 512 //runleft
if GetSpritePhysicsVelocityX(main.spr) > -400
SetSpritePhysicsVelocity(main.spr, GetSpritePhysicsVelocityX(main.spr) - 50, GetSpritePhysicsVelocityY(main.spr))
endif
endif
if GetPointerX() > 512 //runright
if GetSpritePhysicsVelocityX(main.spr) < 400
SetSpritePhysicsVelocity(main.spr, GetSpritePhysicsVelocityX(main.spr) + 50, GetSpritePhysicsVelocityY(main.spr))
endif
endif
else
if GetPointerState() = 0 //idle
if GetSpritePhysicsVelocityX(main.spr) <> 0
SetSpritePhysicsVelocity(main.spr, GetSpritePhysicsVelocityX(main.spr) * 0.9, GetSpritePhysicsVelocityY(main.spr))
endif
endif
endif
endfunction
and using the following to trigger the cannon.
if GetRawTouchCount(1) = 2
SetSpritePhysicsVelocity(main.spr, 0, GetSpritePhysicsVelocityY(main.spr))
loadanim = 1
playerstate = 2
endif
The problem is that iit feels pretty rough while playing. Does anyone have any suggestions of a better way to handle these inputs that will feel a little more solid?
As always, I am thankful and appreciative of any and all suggestions!
One smart fellow, he felt smart. Two smart fellows, both felt smart. Three smart fellows all felt smart...