Hi , I’m making a game , a FPS game with a RTS look , I need to make a mouselook like Alien Swarm , the mouselook style is the character follows te direction of your mouse , and when you shoot , the bullet shoots to the mouse direction. It is possible?
It’s just been less than an hour - hold on. Anyway, yes, a game like Alien Swarm is possible. You will need to learn Python, and this isn’t a ‘couple lines of code’ kind of thing. It will need to do the following:
Make the cursor (in an overlay scene) follow the mouse. You can do this by using the logic.mouse object, and getting its position, then moving the cursor object to be that position divided by the width and height of the camera in the overlay scene. This can be done with code from the game scene.
Get the camera in the GUI scene logic.getSceneList(), and then use its getScreenPosition() property to find where the cursor is on-screen. Do the same thing with the Player to get his position on-screen.
Use the math.atan2 function to find the angle between the Player and the Cursor, and rotate the Player to face that direction.
If you don’t know how to do any of these things, someone could make you an example. However, if you want to implement more of these game interactions in the future, it may be a good idea to learn Python.
Well, I’m not sure of how similar Python is to Batch, though I found Python fairly easy to learn. As for my game project (GridSpace), development has slowed down quite a bit, as I’ve been working on a consecutive game project (that’s looking very good).