dop2000's Forum Posts

  • Check the source code, maybe there is an floor/round/ceil/trunk function somewhere.

  • Container is a good idea. Add arrow to the same container with troop sprite. When you pick a troop instance, its own arrow will be picked automatically. When arrow is not needed, make it invisible.

    If you make an event like "Arrow set position to troop", each arrow will set position to its own instance of troop, because they are in the same container, and you don't even need "for each" loop here.

    Add a bunch of instance variables to troop - for example targetX, targerY, hasRoute etc.

    If I understand correctly, only one troop can be active at a time, so instead of the instance variable isActive, it may be easier to use a global variable activeTroopUID. When a troop is tapped, set activeTroopUID=troop.UID, and then you will be able to pick this troop by its UID in any other event.

    On confirmed destination tile set targetX, targerY to tile x/y.

    On 'Skip turn' you can start moving every troop to its own target tile (targetX and targerY). I suggest MoveTo behavior, but you can use something else.

  • I thought you were still talking about that arrow. If you have several sprite instances and only need to move one, you need to pick it before moving. You can set an instance variable isMoving=true to that instance, or pick it by UID or use some other condition.

  • Instance variable are for permanently storing some values for each instance. Say, if you have Enemy sprite, you might want to add "health" instance variable to it.

    In this event I added a temporary variable, just to make the code simpler. I don't need to keep this variable after the event. So a simple local variable is sufficient.

  • Also try googling something like bullet arc site:construct.net

    This is a very popular question and you may find lots of different solutions.

  • Really cool tutorial, thank you!

    But when I read about advanced random plugin, first thing I thought of was seeded random. Are there plans to add this feature?

  • You do not have permission to view this post

  • With local variables the code is easier to read, and easier to modify if needed. Performance-wise there should be no difference, unless you are doing these calculations millions times per second. (which is not the case)

  • You can download an old version and test, but I doubt it's related to Construct version. Probably some mistake in your project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Open .caproj file in Notepad or other editor, scroll to the end and check if the file is in the correct folder, edit if necessary:

  • 1. Read about IOS limitations here:

    scirra.com/manual/109/audio

    If you are using C2, make sure all sounds are in .m4a and .ogg formats.

    If you have very short sounds (less than 0.1s), this can also be the reason why audio doesn't work on IOS. Make sure all sounds are longer than 0.1s

    4. The proper solution would be making your own keyboard. See this tutorial:

    scirra.com/tutorials/1153/mobile-keyboard-and-hall-of-fame-for-all-mobile-devices

  • What would the differences between moveto and bullet be (I haven't used moveto)? Sounds the main addition would be setting a target destination and rounding/truncating the last step for precise movement. Maybe adding this functionality to the bullet behavior would be good?

    oosyrag I guess it can be added to bullet.

    MoveTo also has MaxSpeed setting, and different settings for acceleration and deceleration. So it's very easy to make natural looking movements - the object speeds up, moves at constant speed and then slows downs to stop. Making the same with bullet will require a lot of events...

    Pathfinding comes close to this, but it has its own issues - you need to find the path first, and sometimes the object does not stop precisely where it should.

  • Yeah, effects are slow on mobile. If you have lots of small sprites with effect, it's better to apply it to a layer.

  • You are doing the loop on every tick, this is wrong. Also, "Trigger once" doesn't work like this, it's also wrong.

    If you just want to count the number of instances, use Count and PickedCount expressions. For example:

    Product compare instance variable type="wool"
     -> Text set text "Total products: " & Product.Count & " wool: " & Product.PickedCount
    
  • every tick -> rotate 600*dt degrees toward (Touch.X, touch.Y)

    I tried this on a very old Android phone and I'm getting 60 pfs and 10-20% cpu utilization. So there must be something wrong with your project.