HoodUPdev's Recent Forum Activity

  • OMG WOW!!!! I seriously didn't expect you to create everything for me...! THANK YOU SO MUCH YOU ARE MY HERO

    I almost feel guilty to use this lol

  • oops forgot to upload the image of your code

    here it is:

  • Not exactly the answer I was looking for, but thank you very much for your advice.

    However there is a flaw in your code... The lasers get created properly but they don't follow the player afterwards. I thinks it's because when you use 'for each enemy', it only performs the action once for each enemy.... Here's the code:

    What I want is this:

    1. When the player touches the item, it creates lasers for each enemy on the screen. Only them, not other enemies that appear later.

    2. Wherever the player and the enemies are, the lasers keep attached to them when they move

    3. After a certain time the enemies who were attached with lasers get destoyed.

    My best try was the image from up there but as I said it sometimes wouldn't create the lasers for whatever reason and also when it did, the lasers would lock on to other enemies as you mentioned.

    I know it's a bit too much to ask for but I would love to get some help.... I'm very new to Construct.

  • So I discovered this weird behavior and I don't know if it's my mistake or a Construct 3 bug.

    I made a simple test project where you can control this diamond-shaped player by clicking anywhere for it to teleport instantly to that point. There are circle-shaped enemies which you can kill by casting a laser(which I named LineExecution) at them, by obtaining the item in the middle. If you look at my event sheet, theoretically, when the player touches the item, it should cast lasers to all enemies and play the correct sounds. This works perfectly in Debug mode. But in normal Preview mode, when I click and move the player to certain places, it doesn't work correctly and only plays the sound. The image of the item was one of those places. (The player is big enough to touch the item even if I click somewhere near the item)

    First image is the Preview mode, Second is Debug mode. Both were took immediately after I clicked on the image of the item.

    This is the way I move the player, in case it matters. Ignore the 'MovesLeft' and 'StartX/Y' stuff

    The speed of the player is set to 100000. The reason I did that instead of just setting the position is because I wanted the player to pick up the item if it travels through the item.

  • oh forgot to mention, lineExecute is what I call the laser ability in my game

  • Thanks for the reply!

    Finally solved it.... but I got another problem here. When the player dies during the laser cast (btw I'm not referring to 'RayCasting'), I wanted it to cancel the casting. The way I tried to do it was this:

    The laser itself does get destroyed when the player dies, but the enemies still get killed. I thought if you deactivate the group, it would cancel the 'wait' action and every action after it, but they still get executed....HELP

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I created a simple game where the player can shoot a laser that locks on to the targets and destroys them after a certain time. However whenever I recast my laser after I destroyed all the targets, it keeps locking on to (0,0), even though nothing is there. I of course thought about putting another condition using 'AND' conditions so that the laser only fires when targets exist, but that wasn't possible because there was already an 'OR' condition there. Please help.

    Also I have another question: How do you distinguish each object? So originally I thought of casting the lasers to only the targets within a certain distance from the player, but I didn't know how to let the game distinguish the targets that are within the distance, so if I set the action to destroy the targets, it will literally destroy every target in the whole game. There definitely must be a possible way but I can't figure it out... please help.

HoodUPdev's avatar

HoodUPdev

Member since 5 Feb, 2021

None one is following HoodUPdev yet!

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies