vee41's Forum Posts

  • Here is an example on how to handle collisions between two instances of same object:

    Evil sprites example

    In your case, it seems a single event would do:

    Rock, on collision with rock

    -- Set rock immovable to false

  • You could type all names in a single string variable, separated by ; or whatever you prefer (one string for each race perhaps). Then when you wish to assign a random name from the string do this:

    NameVariable = tokenat(NameString, floor(random(tokencount(NameString, ";"))), ";")

  • Should work, your problem is probably elsewhere. Got .capx you can show?

    for each NPCS

    .. distance(Player.X, Player.Y, NPCS.X, NPCS.Y) < 100

    ... set variable to 1

    .. else

    ... set variable to 0

  • Shouldn't you check the distance between NPC(family) & Sprite2(player)?

  • Try pathfinding with setting 'diagonals' disabled.

  • The little I've used pathfinding, it works by dividing the map in 'squares' (you can define the sizes in settings). The difference in your cases probably is, that in lower test there is 'half blocked' square which the pathfinding object can't use, thus it goes to the square below it.

    EDIT: Manual describes this in more detail.

  • You can use families for that, or alternatively put all bullets in single object and all enemies in single object.

  • Check out canvas object, I recall seeing great example of worms like terrain done with it so search for that as well. :)

    And yes, million little objects would be performance killer. Thousand or few could be doable, but anything more would kill the performance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Workaround would be to set one object in game to use timescale 1 even when slow effect is going on, and take reload dt from object.dt

  • Looking better every update, keep it up! :)

  • Here is an old example you should be able to apply in your situation:

    Gun example

    If you take the first few events and simplify them for one weapon, you'll have what you want. It's basically the same idea as before, you'll add dt to a variable until it is greater than the fire rate, when it is the gun fires. Then you set the variable to 0 and start all over again.

    Like I said before, you are missing the 'for each enemy' from the point where enemies fire; if you don't have 'for each' every ship will take fire rate variable from the first instance of enemy ships. :)

  • Yes, wait 0 can be used to 'break up' events. Here is what I came up with, made few other changes to the project. Colors can be now set with single event, no matter how many you add. That should simplify things quite a bit.

    I wasn't really sure what your final intention on picking and choosing colors for corners is, so I just set the to pick the color of closest circle.

    Also notice how I used local variables 'blue' and 'purple' to keep things a bit cleaner. I never like to reference to a number inside code, rather into meaning of that number :)

    Colored corners

  • One not too efficient idea: use an array with size of screen width/height where you track which pixels are shown and which not. Whenever new object is created, 'create' it inside the array as well based on radius/coordinates.

  • You have a visibility problem, which in my opinion is the most illogical and annoying feature of Construct 2: objects created cannot be referenced(picked) before next top level event.

    In your case I'd reformat your code to use CornerSprite 'On created' rather than the function.

  • Give them variable group.

    Now you can do stuff like:

    on left click

    sprite.group = reds

    .. Move sprite to mouse x,y