Weapon goes to wall and stops, no overlapping?

0 favourites
  • 7 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • I'm making a sidescroller platform and the character's main weapon is a laser he shoots from his eyes.

    <img src="http://i.imgur.com/pB9R4bP.png" border="0" />

    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.

  • 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.


    oops i forgot to mention, the spacebar toggles the laser on, I dont know how you have it set up.

  • 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.

  • dl.dropbox.com/u/91685197/laserDistance.capx

    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.

  • 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.

  • 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.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)