vee41's Forum Posts

  • Thats a bit different principle, my idea is to just set the animation based on badguys angle. Posting a .capx of your problem would help a lot :)

  • Depending when/where you bought you'll get email or notification about the bundle. Here is some info: construct.net/en

    You can always contact support with problems and I'm sure they'll set you up :)

  • Pleasure to help, good to know they got steam stuff working properly too! :)

  • Would something like this work for you:

    for each badguy

    badguy.angle > x

    badguy.angle < y

    .. set animation to z

    Repeat for each animation.

  • Remove all pick random conditions and add For Each zombie - condition after your every x seconds condition.

    The idea is that whenever you randomize the direction, you do it for each zombie. The direction conditions just move the zombies with specified directions. :)

    Also, instead of global variable (every zombie has the SAME direction) you should use instance variables. Give your zombie object 'Direction' variable and modify your every x seconds condition to set that instead of global variable.

  • Here is a demo that has similar situation:

    Evil sprites demo

    On collision trigger they are both picked, so you have to 'browse' through them using pick nth instance.

  • yess its working now.

    Thank you so much.

    But could you elaborate the logic of the population being reset to 0 every 1 second?

    If you keep adding to it every second, you'll get your total population added to it once per second. That's why we need to set it 0 before 'refreshing' the value :)

  • In your every tick event you are setting direction to random, that would cause the spinning. Move that under the random condition. Also take out 'female_zombie_direction' conditions away from under that condition, and move them to the top level. You can remove the every tick condition all together. Might work. :)

    EDIT: Also, rather than round/random use choose(0,1,2,3)

  • Variable TotalPopulation

    Every 1 seconds

    ..Set TotalPopulation to 0

    ..For each Sprite

    .. Sprite.owner = 1

    ... add Sprite.population to TotalPopulation

    .. Set PopulationTextObject text to ("Population is " & TotalPoulation )

    That will count every player owned sprites population together, was this what you were after?

  • Made few fixes:

    Fixed project

    Few notes: You could use containers and families to simplify your project a lot, just by using those you could have 75% less events with 100% of the functionality and 200% more manageability! :)

  • i did the global variables, but i can't seem to get it right. I can't understand much from the links. Is it okay for you to explain in more detail?

    Thank you very much :)

    At the event '-> On drag start' you'll need to set those global variables to position of your object:

    DragStartX=Object.x

    DragStartY=Object.y.

    Then on event '->dragNDrop dropped':

    if(not overlapping TargetObject)

    .. set object.x to DragStartX

    .. set object.y to dragstartY

  • Check this thread for some discussion about that topic. It's not really a problem, you should aim to make your events as easy to manage and understand as possible rather than doing them with as little characters /rows as possible. Most performance hit will come from a) visualization b) inefficient events. 60 events for movement does sound a bit steep, but I don't know how complex your movement system is :)

    You can find more info on performance here.

  • Don't think editing families runtime is possible.

  • I'll take a look into triggers, but I should point out that I'm aware that the code above isn't the best approach. I'm using this approach because I need to store the newly created object, then work with it in a new top-level event which is a C2 issue.

    I'd still recommend you use 'on created' trigger, no need to save UID's or other stuff anywhere. It's a very coderish approach. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could so something like in this example:

    Evil sprites example

    There are lots of ways to do it, this is a simple approach where you define the spawn range from the middle of the layout (scrollX, scrollY).