Weapon goes to wall and stops, no overlapping?

Get help using Construct 2

Post » Fri Mar 01, 2013 7:22 am

I'm making a sidescroller platform and the character's main weapon is a laser he shoots from his eyes.

Right now it goes through solid objects, but I want it to stop at contact with a solid object. Either by scaling the horizontal to only go from the character to the wall, or just mask the part of the sprite that's too far to the right (or left, if facing the other direction). I tried making a Laser_Contact object, but I don't know how to set its position to the collision point where laser hits wall.
B
6
Posts: 13
Reputation: 478

Post » Fri Mar 01, 2013 8:28 pm

Hi Glebs,
I'm still pretty new, but I tried making a .capx to see about using abs distance (read about it in a thread a while back). I think it might be a bit difficult to explain, but have a look at it and see if it can be of any help. I set up the lazer object to detect the distance from the player and the wall. I did not alter the origin image point for the wall so I added that "64". It works sorta, but works weird, will probably work ok with the right tweaking. Hopefully one of the more seasoned pro's can chime in on this.
https://dl.dropbox.com/u/91685197/laserDistance.capx
oops i forgot to mention, the spacebar toggles the laser on, I dont know how you have it set up.Auntie Val2013-03-01 20:29:54
B
20
S
2
Posts: 257
Reputation: 2,431

Post » Fri Mar 01, 2013 10:44 pm

I would think that you need to put the contact point/origin to the front of the laser so that it detects the contact at the leading tip of the beam.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Sat Mar 02, 2013 3:21 am

[QUOTE=Auntie Val]
https://dl.dropbox.com/u/91685197/laserDistance.capx
[/QUOTE]

Thank you for trying to help me out. Sadly your capx is a version too new for me to open. Once Steam rolls 120, I'll have a look at your file.
B
6
Posts: 13
Reputation: 478

Post » Sun Mar 03, 2013 8:35 am

@glebs you should be able to get it on steam, go into the properties of construct in the steam list and set it to download beta updates.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Fri Mar 08, 2013 8:22 pm

So I found out Steam's ultra-janky way of updating C2 and ran the capx. It's very close to what I want as far as the weapon and wall interaction goes.

However, standing on top of a "Wall" leads to screwiness because the "Pick Nearest" is going off that instead of whats in front of the player.

I think what I'm going to end up doing is make some of the early walls thicker and make the wall-piercing a Feature instead of a Bug.

That being said, feel free to contribute if anyone gets a good idea to do what I'm trying to get done.

Thanks!
B
6
Posts: 13
Reputation: 478

Post » Fri Mar 08, 2013 9:22 pm

Unsure if your using a sprite for your beam,but Use a tiled background for your lazer..when it fires have the width increase...on contact with wall..set width to current width and set your contact point sprite there

To fire at 180 degrees use minus values for your tiled background width...that will basically mirror it.....not tried this but should work.
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260


Return to How do I....?

Who is online

Users browsing this forum: Draconinho, luisgmolina, Magistross, nedzad, nimos100, R0J0hound, Rezzon71 and 31 guests