Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hey all, Hopefully, it's just an easy one, but I'm looking to have a top-down game, and the scene node be controlled by keyboard (WASD). However, I'm looking to have just a 4-way movement with the mouse depicting where shots are fired. So W always moves node upwards, A will always be left, etc. The third person shooter player behaviour is almost what I'm looking for, however, I'm not sure if the script can be tweaked to accommodate. |
||||
|
Ah, that's interesting. You could do this manually, by using "move to position" actions, this should work, I think. |
||||
|
If I do understand well, you can create a top view simple camera looking on your scene ground 90 degrees (perpendicular) and use normally the third person shoot movement. |
||||
|
Now I feel real dumb :P Niko, I don't have that action, either in my regular list or when attached to say "when key pressed" actions. Uh-oh! techno-valley, I did try using that but when you press either left or right it rotates the object. I'm looking for the scene node to stay in a fixed position (roation) and just move without rotating. What I'm trying to do achieve is a top down shooter like Waves / Waves 2: https://www.youtube.com/watch?v=... |
||||
|
hi hgi, wild-master made a pretty good example of how to move an object with the WASD keys here. --> http://www.ambiera.com/forum.php... however, this is frame-dependent movement, and you'll want frame-independent movement probably so I have explained how to do that here. --> http://www.ambiera.com/forum.php... and finally, if you want to shoot in the direction of where the mouse is at on the screen... hm... that's an interesting one. I havn't tried that but you could start by getting the mouse position with javascript using this: ccbGetMousePosX(); and then calculate the direction to shoot based on the position of the mouse. |
||||
|
Tim12345, thank you so much (would have responded earlier but I've been laid up in bed with the flu) That is exactly what I'm looking for. :) thanks again All the best |
|