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

Get help using Construct 2

Post » Sat Mar 04, 2017 1:25 pm

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 : https://www.youtube.com/watch?v=YUzPB4iahB4

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.
http://into-media.co.uk/~clients/sssbbg/CrosshairTest/

Thanks in advance.
Last edited by Aergo on Sat Mar 04, 2017 8:32 pm, edited 2 times in total.
B
13
S
2
Posts: 10
Reputation: 645

Post » Sat Mar 04, 2017 2:16 pm

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.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sat Mar 04, 2017 2:43 pm

Message: Aergo can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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
B
13
S
2
Posts: 10
Reputation: 645

Post » Sat Mar 04, 2017 2:51 pm

Aergo wrote: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?
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sat Mar 04, 2017 3:04 pm

lamar wrote:
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.
B
13
S
2
Posts: 10
Reputation: 645

Post » Sat Mar 04, 2017 3:09 pm

Aergo wrote:
lamar wrote:
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!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sat Mar 04, 2017 4:09 pm

lamar wrote:
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
B
13
S
2
Posts: 10
Reputation: 645

Post » Sat Mar 04, 2017 4:19 pm

Aergo wrote:
lamar wrote:
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!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sat Mar 04, 2017 4:28 pm

Message: Aergo can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
lamar wrote: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.

https://www.youtube.com/watch?v=4CiAHOAEjgU
B
13
S
2
Posts: 10
Reputation: 645

Post » Sat Mar 04, 2017 4:46 pm

Aergo wrote:
lamar wrote: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.

https://www.youtube.com/watch?v=4CiAHOAEjgU


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!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Next

Return to How do I....?

Who is online

Users browsing this forum: OBLIVION, unicornspitfire, zenox98 and 11 guests