Best way to make laser ???

Get help using Construct 2

Post » Sun Jul 13, 2014 9:23 pm

Hi all

I have laser sprite with sine behavior, And i want to prevent it from overlapping the obstacle, And when not overlapping it will return to the default size.

Any help will be great
Thank's
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Sun Jul 13, 2014 9:39 pm

I'd be glad to help if you could give more information..

Would creating a sprite which detects overlap at an imagepoint on the end of the sprite help?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 13, 2014 10:46 pm

@LittleStain thank's alot
As you can see the blue laser is the same sprite with different sine behavior.
And the player can escape from it by stand behind obstacles.

Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Sun Jul 13, 2014 11:34 pm

There are as always very many ways to go about this..

Here's a very old but working example by @R0J0hound
It's for rotating lasers, but will work for this purpose too..

http://dl.dropbox.com/u/5426011/c2/laser.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 14, 2014 11:22 am

Thank's for the capx
Perfect example.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Mon Jul 14, 2014 9:13 pm

If there a way to set fixed size for the laser and when overlapping obstacle the laser will shrink.
Or like a camera view searching for the player but can't view behind obstacles.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Mon Jul 14, 2014 9:51 pm

I'm not sure what you mean..
Ofcourse you can hardcode the laser size, but then it would just be easier to do it based on position rather than overlap, because if you shrink when not overlapping, it will never overlap again. Ofcourse using overlapping at offset could be of help in this situation, so maybe go there?
If youd like you could try and use the line of sight behaviour, but I think it's overkill for this situation.
What is "wrong" (not working for you) with the example provided?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 14, 2014 10:16 pm

Thank's Stain
i want to make this camera view, I've searched the forum but couldn't find anything, except of using Canvas plugin and i don't want use third party plugins.
You do not have the required permissions to view the files attached to this post.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 5 guests