Dangerous Dave style shooting?

Get help using Construct 2

Post » Tue Jan 17, 2017 6:13 pm

I think beams are as long as the distance to the first thing they hit.
I think the original didn't have a beem.
Image ImageImage
B
171
S
50
G
179
Posts: 8,388
Reputation: 113,470

Post » Tue Jan 17, 2017 6:44 pm

newt wrote:I think beams are as long as the distance to the first thing they hit.
I think the original didn't have a beem.

I agree the original didn't, but I think the ray tracer is fun to try, I just can't work out how long I should shoot the ray and what angle to shoot up?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Tue Jan 17, 2017 8:26 pm

Well the platform example is a lot diferent than the game.
In the game the enemies are all at set heights, so hitting the up or down arrow just meant you want to shoot something on the next level up, or the one below, so there is no angle to find.
In the platform example, all enemies can be at any height, so a specific angle is pointless.
Image ImageImage
B
171
S
50
G
179
Posts: 8,388
Reputation: 113,470

Post » Tue Jan 17, 2017 9:11 pm

newt wrote:Well the platform example is a lot diferent than the game.
In the game the enemies are all at set heights, so hitting the up or down arrow just meant you want to shoot something on the next level up, or the one below, so there is no angle to find.
In the platform example, all enemies can be at any height, so a specific angle is pointless.

Yeah, but he doesn't always hit the monsters if he's not in range or at the right angle, does he?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Thu Jan 19, 2017 6:02 pm

newt wrote:Well the platform example is a lot diferent than the game.
In the game the enemies are all at set heights, so hitting the up or down arrow just meant you want to shoot something on the next level up, or the one below, so there is no angle to find.
In the platform example, all enemies can be at any height, so a specific angle is pointless.

How can I keep point B at the exact same angle between A, regardless of how long the distance between A and B is?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Thu Jan 19, 2017 6:22 pm

You pick an angle. 0 degrees is that way ->. 180 is that way <-.
You would probably want something like 315 for top right, and 225 for top left.
You use the mirrored condition to tell when to use the opposite angle.
Image ImageImage
B
171
S
50
G
179
Posts: 8,388
Reputation: 113,470

Post » Thu Jan 19, 2017 10:56 pm

newt wrote:You pick an angle. 0 degrees is that way ->. 180 is that way <-.
You would probably want something like 315 for top right, and 225 for top left.
You use the mirrored condition to tell when to use the opposite angle.

Yeah, but how do I set the length of the ray to be the edge of the viewport and keep the angle correctly?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Thu Jan 19, 2017 11:22 pm

As I tried to say before the ray doesn't care where the edge of the viewport is.
Furthermore you can't get that position without some actual raycasting, and the viewport offers nothing to cast against, unless you make some dummies.
However, you can presume that the layout width divided by two would be long enough to ensure that it will always end off screen.

Perhaps you could describe exactly what you want to do. Step by step.
You keep asking for an angle, and I have no other frame of reference other that those I've already addressed.
Image ImageImage
B
171
S
50
G
179
Posts: 8,388
Reputation: 113,470

Post » Fri Jan 20, 2017 1:08 pm

newt wrote:As I tried to say before the ray doesn't care where the edge of the viewport is.
Furthermore you can't get that position without some actual raycasting, and the viewport offers nothing to cast against, unless you make some dummies.
However, you can presume that the layout width divided by two would be long enough to ensure that it will always end off screen.

Perhaps you could describe exactly what you want to do. Step by step.
You keep asking for an angle, and I have no other frame of reference other that those I've already addressed.

Image
That's where the angle stays the same regardless of the position the player is towards the right-hand side of the screen, however, this is because the end point is fixed and it goes outside of the edge of the viewport, How can I keep this angle exactly the same AND keep the end point no further to the right than the viewport?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Fri Jan 20, 2017 8:02 pm

Is mirrored
->trigger once
-->set ray angle to 225
else
->trigger once
-->set ray angle to 315

Im still not worried about finding the point where the ray meets the viewport.
It does nothing for game play, and has no negative impact.
Image ImageImage
B
171
S
50
G
179
Posts: 8,388
Reputation: 113,470

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: jezjones24, Lancifer, newt, R0J0hound and 21 guests