Hi,
I’m trying to implement the best method regarding Touch, using below:
http://cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/internal-events/
for my game, but I have a question regarding it’s use…My game consists of below:
- Player - Will use Touch to move around the screen while dragging the finger
- Power Bullet Button ( HUD ) - Will press the Button to fire Bullets
- Player - Will press the actual player ( node ) to fire bullets…
So I have 3 objects that I need Touches on, what is the best way to implement this, right now I have:
-
Power Bullet Button ( HUD )
this.theubutton.on(cc.Node.EventType.TOUCH_START, function (event) { -
Player - Shoot Bullets
this.node.on(cc.Node.EventType.TOUCH_START, function (event) { -
Player - Move Around
this.node.on(cc.Node.EventType.TOUCH_START, function (touch,event) {
So as you can see I have 3 Touches…? Should I add the player as a child to the ground node, and transfer the Touch Method of the Player - Move around to the ground node and have the player move around as per Touch on ground node? Would really appreciate help regarding this question…Thanks and God Bless…
Sincerely,
Sunday