HoodUPdev's Forum Posts

  • I want to make the color of a shape a gradient, which dynamically changes when the shape moves around the screen. (Just like the gradient chatroom theme on Facebook messenger.)

    I tried to achieve this by creating a layer with the gradient image, add the shape on another layer on top of that, set the effect of the shape to "Destination Out.", and enabling "Force Own Texture" on the upper layer. When I do this, it perfectly works as I want.

    The problem is, my game has a lot of objects and I should be able to turn the gradients on and off (because I'm making it as an additional theme), so it's really inefficient to manually adjust the effects for every object.

    (And also there was this weird bug where newly created instances from the same object appeared invisible, when the manually placed instances worked fine)

    Well, simple solution, just make the effect of the layer to "Destination Out", right?

    But when I did that, every object on that layer turned completely black.....any ideas?

  • Thanks! Enabling the 'static' option worked.

    But I don't really understand what that option is meant for though... I read through the documents and learned that it makes the local variables reset every tick, but why is that useful?

  • You do not have permission to view this post

  • drive.google.com/file/d/1SOSvZ6nPQea8HJjaOWF_XmZ7e7FrSweF/view

    If I put the global variable into a group and turn it into a local variable, everything breaks... Isn't it supposed to work??

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Perfect. I learned a lot from you thank you very very much!!

  • You do not have permission to view this post

  • You do not have permission to view this post

  • oops the first image is gone here it is

  • It works really well, thanks again!!

    I just want one tiny thing to make it even better though...

    I tested your project and everything was fine, but whenever the enemies were cramped up, the lasers attached to them looked a bit weird. Look at the image and you'll understand.

    What I want is this:

    I tried to fix it using the 'set Z elevation' on the laser object and setting it to 'enemy.Zindex', but sadly it didn't work...

    sorry for keep asking for help haha but you are too good at this!!

  • 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