bebenleneufe's Forum Posts

  • 5 posts
  • Wow that's a very good idea, I will try it right away, thank you so much :D

  • Hi everyone!

    I'm trying to make a simple automation factorio-like game, however i'm facing some issues.

    In order to generate the map I've started with the "Procedural Terrain Generation" from the example browser, and that's very nice, the chunk system works nicely when seen from above too, so chunks of terrains are saved in a JSON and loaded when needed, perfect.

    So I need to destroy and recreate sprites while the player moves around in order to save up on memory, which i did, it works, awesome BUT I need the factories, furnaces, etc... to keep working even when destroyed!

    So I thought, well I will put every structures in an array that will control everything from backstage (factory production, conveyor belts, etc...) and will be refreshed every tick or so.

    But that means that even with a map of 100*100, and with an array depth of 50 in order to register data from every square, that would already be 500.000 array cells to be read every ticks, no way that wouldn't overload the CPU.

    Plus the size of that array is currently limited, I don't know how to resize it and make it go larger in every way in order to register the player's expansion in the world.

    So two questions really:

    1. How would you deal with managing factories and belts in the background?
    2. How can I resize the array dynamically, is it even the right way to go about it?

    Thank you so much for any help or idea :)

  • You're entirely right, you corrected my first problem too by talking about instance picking ! I added the line and the rebound works like a charm !

    For the "destroy" part, I think there IS a monster overlapping on arrival, but for some reason the lightning doesn't move right away, so the condition "not overlapping" and "on arrival" do not activate, and it stops moving.

    I'm going to search a bit I think I'm onto the answer, thanks again !!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for your answer !

    Here is the event basically, after finding the target :

    And I'm going to try the second part, thanks so much !

  • Hello everyone,

    I'm making a sort of tower defense, and one of the tower sends "bouncing" lightning.

    The way I wanted to go about this was to make the tower have a turret behavior, spawn a lightning going to the monster.

    The lightning also has the turret behavior, and should, on collision with a monster, target a new one until its number of bounces reaches 0, upon which it is destroyed.

    I have two problems though :

    • If my lightning reaches its destination and the monster has moved, it simply stays put, not dying. The way I tried to go about this was something like "If move-to destination reached and no Monster collision detected, then destroy lightning" but it doesn't seem to activate...
    • When it reaches the first monster, i would like to make sure it picks a different one, so i tried to do something like this to make it pick another one, but it doesn't seem to work either :

    Any help or pointer would be really appreciated, thanks a lot !

  • 5 posts