lukezero's Forum Posts

  • > Does anyone here have a working routine (CAPX example) for fading an object to black?

    Can this example help you?

    https://www.dropbox.com/scl/fi/5o1mbh8zgn0nct7l78cbe/darkenobjs.capx?rlkey=c58fdi4jgpwq7fkckz22ucivy&e=1&st=rp8986nj&dl=0

    Than you so much! :D

    It worked very well, as exactly I expected!

  • I think everyone is using AI and no one cares about the human factor here (or C2) anymore. :(

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My current fade routine is the one above. It works well, HOWEVER, it makes the enemy (zombie) first turn white and only then darken. Does anyone know how to fade directly to black?

  • Try using the Tween behavior on the Color property:

    https://www.construct.net/en/make-games/manuals/construct-3/behavior-reference/tween

    Thanks, dude, but I'm using Construct 2. :)

  • Hi guys!

    Does anyone here have a working routine (CAPX example) for fading an object to black?

    I tried several times using some effects (Tint, for example) and failed every time (even using AI). :(

    Thanks in advance!

  • It’s short enough and simple enough you can try changing it and see. I thought defining the paths with sprites was simpler. I won’t be making an array version.

    No problem, man. I'm already testing it here using Array. Thanks again. :)

  • dropbox.com/scl/fi/uhb13xxjy0lzqn6ssnq7a/path_follow.capx

    Thanks a lot, dude! It worked well! :D

    Do you think that a alternative routine with Array would work as well as the current routine with translucide red dots?

    NOTE: My project has a screen size of 1280x720.

  • I mean, the last post was instructions of a way to do it. If I made a capx it would only follow those instructions. I’ll defer to other people’s solutions in the meantime. There’s a lot of other things vying for my time currently.

    I tried, but unfortunately it didn't work. I tried a few variations, with the help of an AI, and it still didn't work. That's why I kindly asked for an example in CAPX, because I honestly couldn't get this code to run. :(

  • There isn’t a best way. There are many different ways like I roughly listed in the previous post, each with pros and cons. But realistically you’d just pick one.

    Create a sprite and call it node. Give it two instance variables: path and index. You’d then place instances of node on the layout in the shape of the path you want. Next you’d set the instance variable values. You’d set index to 1 for the first node, 2 for the second, and so on. You’d then set path to the same value 1 for all of them. You can create more paths later by just having different values of path.

    Next you need something to follow the path. Create a sprite and call it mover. Give it two instance variables: path and target. Also give it the bullet behavior.

    In events you’d then do something like

    Start of layout 
    — mover: destroy
    
    On click
    Node: path=1
    Node: index=1
    Repeat 10 times
    — create mover at (node.x-loopindex*32, node.y)
    — mover: set path to 1
    — mover: set target to 1
    
    For each mover
    Node: path=mover.path
    Node: index= mover.target
    — mover: rotate 100*dt degrees toward (node.x,node.y)
    
    Mover: on collision with node
    Node: path=mover.path
    Node: index= mover.target
    — mover: add 1 to target

    You can change the rotation speed by changing 100*dt. You probably want to change the bullet speed too. Too fast with too slow of turning will prevent it from being able to reach the next node, but that’s easy to tweak. You can change the amount and spacing of the movers in the event that creates them. You probably want to delete the movers once they reach the end of the path somehow.

    As an exercise you could also stretch a sprite between consecutive movers to avoid visual gaps.

    Edit:

    Third party plugins are useful, but users seem to avoid them because they don’t like that the people that made them don’t usually stick around till the end of time to fix possible issues that come up from browser or construct change. You’re already using c2 that could possibly break from a browser change although that’s not very common. As to if third party plugins make it harder to port? That’s a question for those who do the porting.

    Dude, I tried to adapt your code to my routine (which procedurally generates a wind particle every 2 seconds on the right side of the screen, making it go to the left side), but I just couldn't do it. Maybe it's tiredness and/or inability to program, but now I couldn't do it. :(

    I tried to use AI to help me with the routine, but it only made the situation worse. If it's not too much trouble, could you create a CAPX example for me with this context?

  • There isn’t a best way. There are many different ways like I roughly listed in the previous post, each with pros and cons. But realistically you’d just pick one.

    Create a sprite and call it node. Give it two instance variables: path and index. You’d then place instances of node on the layout in the shape of the path you want. Next you’d set the instance variable values. You’d set index to 1 for the first node, 2 for the second, and so on. You’d then set path to the same value 1 for all of them. You can create more paths later by just having different values of path.

    Next you need something to follow the path. Create a sprite and call it mover. Give it two instance variables: path and target. Also give it the bullet behavior.

    In events you’d then do something like

    Start of layout 
    — mover: destroy
    
    On click
    Node: path=1
    Node: index=1
    Repeat 10 times
    — create mover at (node.x-loopindex*32, node.y)
    — mover: set path to 1
    — mover: set target to 1
    
    For each mover
    Node: path=mover.path
    Node: index= mover.target
    — mover: rotate 100*dt degrees toward (node.x,node.y)
    
    Mover: on collision with node
    Node: path=mover.path
    Node: index= mover.target
    — mover: add 1 to target

    You can change the rotation speed by changing 100*dt. You probably want to change the bullet speed too. Too fast with too slow of turning will prevent it from being able to reach the next node, but that’s easy to tweak. You can change the amount and spacing of the movers in the event that creates them. You probably want to delete the movers once they reach the end of the path somehow.

    As an exercise you could also stretch a sprite between consecutive movers to avoid visual gaps.

    Edit:

    Third party plugins are useful, but users seem to avoid them because they don’t like that the people that made them don’t usually stick around till the end of time to fix possible issues that come up from browser or construct change. You’re already using c2 that could possibly break from a browser change although that’s not very common. As to if third party plugins make it harder to port? That’s a question for those who do the porting.

    Thanks again, dude. You're awesome!

    I'm testing here using a procedural routine. :)

  • > without the need for plugins?

    u have to use plugins for that ofc

    anyway i dont see the problem as c2 has the plugin needed-pathfinding-as rojohound said

    also that yt vid probaly used addons no?

    Actually I prefer to don't use plugins, since I had problems before with them.

    Also, my game will be ported to home consoles and I believe that using external plugins could cause problems in the conversion, right R0J0hound?

  • You probably should stop posting your question in both the c2 and c3 sections since you’re only after c2 solutions.

    C3 has the timeline editor which probably makes it easy to move things alone a path with minimal events. C3 also has the distort mesh where you can distort a sprite in a curved shape if you wanted.

    In c2 you have to come up with a way to define a path and move along it manually. Theres even some third party plugins to move along a curved path pretty easily.

    A cheap way to move along a path is to use the pathfinding behavior to move from point a to b through multiple waypoints to make the loop.

    You could also use the bullet behavior with a bunch of sprites places to make the curve. You’d have it target the first point by rotating the sprite toward it then when it collides start targeting the next and so on.

    Theres also some more rigorous mathy ways to go about it.

    To give it that curved line look you can just launch a bunch of sprites to move along the path and stretch sprites between consecutive sprites. There are also drawing plugins that possibly could be used for different looks. Or if you space the sprites close enough you may not need to stretch sprites.

    Basically looks like you’d define multiple paths. Then you’d pick one and spawn a bunch of objects to move along it at different offsets. Then you’d use stretched sprites or something to give it a continuous line look.

    Generating the paths on the fly could be possible too. But it doesn’t seem like something that video covers.

    Anyways, just some ideas.

    Sorry again for this, dude, but when I did it, it was out of desperation for a solution. It's quite difficult to work with a small independent team. :(

    What is the best way to do this with video, without the need for plugins? Do you have any examples of this? Once again, I thank you immensely for your attention and collaboration.

  • Does anyone know how to do it in an (almost) identical way to the video above?

  • just asking what software is he using?

    Construct 2

  • Hi dev guys!

    I'm trying to implement a brush/flat design particle in my game that is randomly generated on the outer right side of the screen, always moving towards the left. The brush should scratch the screen in semi-straight, curved and semi-curved lines, just like in the video below:

    Subscribe to Construct videos now

    I tried to do it using this routine, based on a similar one for mobile games, but here it surprisingly only generated long straight lines that start to fill the screen more and more.

    Does anyone have any suggestions or corrections for the current routine?

    Tagged: