(SOLVED) How do I make a 360 degree platform shooter?

0 favourites
  • 13 posts
From the Asset Store
JPEG format 364x HD backgrounds in 2688 x 1536 Resolution
  • Hi, So I have been working on a little platform shooter game which was coming along great until I realised one thing. I don't seem to be able to move the crosshair using the mouse and the platform controls.

    Ok so to explain this better I refer you to : youtube.com/watch

    This is Soldat, you may have seen it before if not, check it out, it's awesome. Anyways you should be able to see from this that the crosshair is locked to the player movement controls so as the player runs around the crosshair moves too. That I can do by pinning the crosshair to the player sprite, however, what i would also like is for the crosshair to move using the mouse controls.

    All the methods I've tried just don't seem to work and I've search around the forums looking for an answer but it seems no one has one so I thought I would push it out as a challenge for someone so hopefully provide a solution to this.

    Here's a link to what I currently have.

    into-media.co.uk/~clients/sssbbg/CrosshairTest

    Thanks in advance.

  • Every Tick: Set Crosshair sprite Position to Mouse.X and Mouse.Y

    The mouse cursor can also be changed to the cross hairs if you don't want to use another sprite.

  • Hi Lamar,

    Thanks for the reply. I have been able to get the crosshair to move with the mouse which is great however it's when I for example jump, i want the crosshair to move with the player sprite. Just like in the game Soldat (video link in first post).

    What I have so far (baring in mind I have just used placeholder sprites for this) is a character that moves and can shoot towards the mouse however I want it to shoot towards the crosshair mot particularly the exact mouse position.

    Here's a link to what I currently have.

    into-media.co.uk/~clients/sssbbg/CrosshairTest

    Thanks again

  • Hi Lamar,

    Thanks for the reply. I have been able to get the crosshair to move with the mouse which is great however it's when I for example jump, i want the crosshair to move with the player sprite. Just like in the game Soldat (video link in first post).

    What I have so far (baring in mind I have just used placeholder sprites for this) is a character that moves and can shoot towards the mouse however I want it to shoot towards the crosshair mot particularly the exact mouse position.

    Here's a link to what I currently have.

    http://into-media.co.uk/~clients/sssbbg/CrosshairTest/

    Thanks again

    The only way to do that I can think of is to turn off the Every Tick event with a variable trigger and then make your cursor sprite follow the Y variable of your player sprite when it jumps and then turn the Every Tick event back on.

    On Jump key pressed: Set EveryTick=0, Set position CursorY to PlayerY

    On Jump key released: Set EveryTick=1

    That should work?

  • The only way to do that I can think of is to turn off the Every Tick event with a variable trigger and then make your cursor sprite follow the Y variable of your player sprite when it jumps and then turn the Every Tick event back on.

    On Jump key pressed: Set EveryTick=0, Set position CursorY to PlayerY

    On Jump key released: Set EveryTick=1

    That should work?

    Thanks again however this issue here is that if I move the mouse when jumping then the crosshair won't move with the mouse as it's only locked to the player sprite.

    The idea scenario would be that I have a crosshair sprite that is pinned to the player therefore will move with the player at all times and when move moves on the x axis then the crosshair adds or subtracts the speed and distance the mouse has travelled. Same for the Y axis. This way moving the mouse on the x axis would move the crosshair up or down respectively and the same for the y axis but when jumping the crosshair sprite would still move up with the player sprite.

    I hope i've explained that well, this has been boggling my mind for a couple of days now and my brain is a little fried! ha.

    Cheers for your responses in trying to solve this issue.

  • >

    >

    > The only way to do that I can think of is to turn off the Every Tick event with a variable trigger and then make your cursor sprite follow the Y variable of your player sprite when it jumps and then turn the Every Tick event back on.

    >

    > On Jump key pressed: Set EveryTick=0, Set position CursorY to PlayerY

    >

    > On Jump key released: Set EveryTick=1

    >

    > That should work?

    >

    Thanks again however this issue here is that if I move the mouse when jumping then the crosshair won't move with the mouse as it's only locked to the player sprite.

    The idea scenario would be that I have a crosshair sprite that is pinned to the player therefore will move with the player at all times and when move moves on the x axis then the crosshair adds or subtracts the speed and distance the mouse has travelled. Same for the Y axis. This way moving the mouse on the x axis would move the crosshair up or down respectively and the same for the y axis but when jumping the crosshair sprite would still move up with the player sprite.

    I hope i've explained that well, this has been boggling my mind for a couple of days now and my brain is a little fried! ha.

    Cheers for your responses in trying to solve this issue.

    OK maybe you missed the part where I said TURN OFF Every Tick?

    That way the sprite you are using for the cursor will no longer follow the mouse and then move that cursor following the Y position of the player and then turn Every Tick back on so the cursor follows the mouse.

    Best of luck!

  • OK maybe you missed the part where I said TURN OFF Every Tick?

    That way the sprite you are using for the cursor will no longer follow the mouse and then move that cursor following the Y position of the player and then turn Every Tick back on so the cursor follows the mouse.

    Best of luck!

    Hi, no I hadn't missed that. You see I want to be able to move the cursor with the mouse while jumping so turning it off would mean that the mouse wouldn't have any control anymore which isn't what I need.

    Thanks anyways

  • >

    >

    > OK maybe you missed the part where I said TURN OFF Every Tick?

    >

    > That way the sprite you are using for the cursor will no longer follow the mouse and then move that cursor following the Y position of the player and then turn Every Tick back on so the cursor follows the mouse.

    >

    > Best of luck!

    >

    Hi, no I hadn't missed that. You see I want to be able to move the cursor with the mouse while jumping so turning it off would mean that the mouse wouldn't have any control anymore which isn't what I need.

    Thanks anyways

    If you are still moving the cursor with the mouse then it will not jump when the player jumps.

    You can't have it both ways!

  • If you are still moving the cursor with the mouse then it will not jump when the player jumps.

    You can't have it both ways!

    Are you saying that because Construct 2 doesn't have the capability to do that. It's just games such as Soldat and another game called Butcher do it perfectly.

    youtube.com/watch

  • > If you are still moving the cursor with the mouse then it will not jump when the player jumps.

    >

    > You can't have it both ways!

    >

    Are you saying that because Construct 2 doesn't have the capability to do that. It's just games such as Soldat and another game called Butcher do it perfectly.

    Subscribe to Construct videos now

    I looked at your video and the cursor is NOT jumping with the player and is using the mouse control.

    You asked how to make it move with the player and that requires turning off that mouse positioning. and I explained how to do that.

    If you want the player to move as the mouse moves then you are asking the wrong question.

    Have a great day and hope you find the answer you are seeking!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I looked at your video and the cursor is NOT jumping with the player and is using the mouse control.

    You asked how to make it move with the player and that requires turning off that mouse positioning. and I explained how to do that.

    If you want the player to move as the mouse moves then you are asking the wrong question.

    Have a great day and hope you find the answer you are seeking

    This is the perfect point in the video to show that as the character jumps the cursor stays with the player but if the play is falling or jumping the cursor can still be moved with the mouse.

    youtu.be/4CiAHOAEjgU

    Furthermore to this the game, Cosmochoria, which has been built in Construct 2 also follows the same principles of moving a crosshair around the game using a mouse but then when the character jumps the crosshair moves with even though the player can still control it with the mouse

    scirra.com/construct2/games/cosmochoria

    I feel you may not have the answer to what I am after and I do appreciate your time in this matter. Thanks for trying.

  • Aergo

    https://www.dropbox.com/s/wdh5b4gcm3xsg ... .capx?dl=0

    Crosshair is on non parallax.

    Game is on parallax.

  • Aergo

    https://www.dropbox.com/s/wdh5b4gcm3xsg ... .capx?dl=0

    Crosshair is on non parallax.

    Game is on parallax.

    You my friend are awesome. This is exactly what I was after. I have been thinking about this all day and trying to work it out and my mind has been stuck in one place. After talking to a friend he also opened my mind to another alternative very much like your solution. So once again, thank you very much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)