dop2000's Recent Forum Activity

  • I made a small mistake, it should be self.a in the last line.

    And of course put the correct animation names instead of "Left", "Right" etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are many ways to do this. For example:

    Every 1 second
    Enemy overlapping PlayerConeOfView
    Enemy Pathfinding NOT moving
    For each Enemy
    
    .. Local variable a
    .. Local variable x
    .. Local variable y
    .. Local variable dist=500
    
    .. set a to angle(player.x, player.y, enemy.x, enemy.y)
    .. set x to enemy.x + dist*random(0.5, 1.5)*cos(a)
    .. set y to enemy.y + dist*random(0.5, 1.5)*sin(a)
    
    .. Enemy Find Path to (x, y)
    
    
    
    Enemy On Path Found: Enemy move along path
    
  • Solution 1 isn't great because on big maps the Pathfinding behavior will be quite slow.

    If your game is grid-based, you can try EasyStarJS behavior, it's much faster. But still will probably struggle if your map is 100000x100000 tiles in size.

    One workaround is to use an invisible tilemap, which you center on the player position and mark all obstacles on it. Then use EasyStarJS to find the path.

  • Are you using Turret behavior just to determine the angle? I'm guessing it won't be good for performance. You can use this expression:

    angle(self.x, self.y, player.x, player.y)

    This will probably be the most efficient way:

    On every tick: 
    
     Enemy set variable a to angle(self.x, self.y, player.x, player.y)
    
     Enemy set animation to (anglediff(a, 0)<45 ? "Right": anglediff(a, 90)<45 ? "Down": anglediff(a, 180)<45 ? "Left": "Up")
    

    "a" is an instance variable on the enemy sprite.

  • 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)

  • 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?

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 249 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x4
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies