How to make a mouselook like Alien Swarm?

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?

A video of the Alien Swarm mouselook:

Thanks for the helping :slight_smile:

help please?

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:

  1. 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.

  2. 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.

  3. 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.

Okay , really thanks SolarLune , I’m trying to learn Python but it’s too difficult , a friend started with BATCH and after learned Python fast , it’s right?

And , if anyone can make an example for me , really I will thank to this caricative soul :slight_smile: Thanks to all.

PD: How are going your game project SolarLune?

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).