Maths Help Please

Get help using Construct 2

Post » Mon Jan 26, 2015 8:15 pm

ramones wrote:Here's the LayerToCanvas/CanvasToLayer approach if you want to see that.


Awesomely short. Did not know this CanvasToLayer stuff either. Thanks.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Mon Jan 26, 2015 8:43 pm

As a way to give back and as a thanks for everyone's help, here's my full enemy indicator code, using multiple enemies in a family marked as 'EdgeTrack' so anything you want tracked, just add it to that family and it should show indicators.

Features:
- Tracks multiple instances
- Indicators Fade out when associated enemies enter the screen
- Indicators Fade back in when enemies leave the screen.
- When enemies enter the screen, indicators change to a flashing 'warning' version.
- Indicators created automatically when a new instance is created
- Indicators destroyed automatically when its parent enemy is destroyed.

Hope this helps someone, thank you so much for your help, especially @ramones who did that final canvas/layer conversion for me.
You do not have the required permissions to view the files attached to this post.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Mon Jan 26, 2015 9:05 pm

small bug in the create/destroy stuff but easy to fix. you'll see it if you just read it line by line. :) creating a new arrow when it destroys the enemy :)
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Mon Jan 26, 2015 9:09 pm

> @80bit : Thanks!

It would be nice to make a version, where the arrow is really at the right position in their right angle. Since both our solutions are a bit off, due just offsetting it in horizontally or vertically rather than radially. (Causing the arrow mostly being off the line between player and target.) Just to make things perfect :)

I might take a look, to figure it out. @ramones maybe you got an idea?
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Mon Jan 26, 2015 10:35 pm

MultipleChoice wrote:> @80bit : Thanks!

It would be nice to make a version, where the arrow is really at the right position in their right angle. Since both our solutions are a bit off, due just offsetting it in horizontally or vertically rather than radially. (Causing the arrow mostly being off the line between player and target.) Just to make things perfect :)

I might take a look, to figure it out. @ramones maybe you got an idea?


Hey man, it's funny because that's actually perfect for me - im not really looking for the position according to the player, im looking for the position towards the edge of the screen.. where maybe in a GTA type situation, you would want the position to the player, this is actually for enemies 'entering the screen' so i actually want to know their exact position they will be entering. In my actual game, the angle itself of the indicator is irrelevant because the angle will always simply be pointing to the edge either up down left or right.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Jan 27, 2015 4:00 pm

> @80bit: I understand, but that does not change the fact even in your case, that the arrow angle and position don't exactly correlate diagonally with your Player/Target "line of sight". It still would look smother if it did. Sure, it's good enough, but it would be challenge to solve that "problem".
B
8
S
3
Posts: 197
Reputation: 1,207

Previous

Return to How do I....?

Who is online

Users browsing this forum: max2612 and 33 guests