dop2000's Forum Posts

  • What kind of game it is? Top down view? Are there walls, obstacles?

    You can pick a random point and try to find a path to it.

    These are the coordinates of a random spot ~500px away in the opposite direction:

    set a to angle(enemy.x, enemy.y, player.x, player.y)
    set x to player.x + random(400,600)*cos(a)
    set y to player.y + random(400,600)*sin(a)
    
  • You can save object velocity in a variable using this expression:

    set v to distance(0, 0, Obj.Physics.VelocityX, Obj.Physics.VelocityY)

    And restore it after teleporting with "Set velocity" action:

    Set velocity X to v*cos(teleportAngle)

    Set velocity Y to v*sin(teleportAngle)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can set up all spritefonts on an unused layout, add them to a family. Then in runtime create a spritefont by name, or substitute the default spritefont.

    Here is an example from my "Multi Language Support" template:

  • In the last event on your screenshot you are checking the distance to base2. But you need to pick the correct base2 instance first! If you don't pick it, then the distance will always be checked to the first base2 instance only. And other base2 sprites will be ignored.

    In the first event when you are picking the nearest base2 instance, save it in an instance variable on Base sprite as a target. Then you will be able to properly pick target base2 to check if it's in range to start the battle.

  • If you are checking the distance without picking an enemy first, it won't work correctly because the engine will only test the first enemy instance. That's why I tell it's impossible to help you without seeing your code. Please post a screenshot of the event sheet of share your project.

  • It definitely works for me.. Make sure to set the right array size first - add lots of empty cells. Then select the first cell (don't double-click) and press Paste.

    If that doesn't work, maybe try a different browser.

  • I don't know about the Numbers app, but you can easily copy entire tables from Excel or Google Sheets. Maybe you can import Numbers file into Google Sheets, and then copy from Google Sheets to C3?

  • Without seeing your code it's difficult to tell what you are doing wrong. "For each" is a safe method to process each instance separately. But updating targets on every tick may not be a good idea.

    You might need a state machine (a set of instance variables on players and enemies). Use Timer/LOS/Pathfinding behaviors to change their state. For example, when a player is in "find_target" state, find the nearest enemy. Then change the state to "chasing" for 2 seconds. On "chasing" timer check if the target is in firing range, if not - re-enter "chasing" again. If yes - change state to "attacking". And so on.

    Look for examples and tutorials on how games like these are made.

  • Here are a few examples, they are old but may still be useful:

    howtoconstructdemos.com/category/virtual-joystick

  • But, I have several sets of bases. All spawning in their own torso. Will I need to make several bodies to corilate to their own group?

    For containers - yes.

    For hierarchies - not necessary, you can combine any objects.

  • for each torso, base.count=torso.count

    What condition are you using? You need conditions which pick instances. For example "Base -> Compare Instance Variable".

    If you are using System conditions like "Compare two values" - they don't pick instances.

    Also, linking with Pin and instance variables is an old method. In C3 you can use hierarchy - it will be much easier. Add Body as a child to the Base sprite. You can select which properties will be synced automatically, for example the angle. And you can use "Base Pick Children" condition to pick the Body sprite.

    EDIT: Container is another option. Or use both the container+hierarchy for maximum automation.

  • Impressive in what sense - too many or too few?

    We use JS for things which are now possible with events and to speed up processing of some big arrays.

  • Are you certain that the parallax is causing poor performance? It's unlikely.

    Have you tried disabling the parallax or removing these backgrounds completely, with fullscreen quality set to High?

  • The game

  • I use Adjust HSL to make them light up if the player is in that room, would this be worth finding another way to do it?

    500 sprites with an effect may explain poor performance. Make sure you disable the effect on sprites that don't need it, not just set the default HSL values.