dop2000's Recent Forum Activity

  • Yes! Once you understand picking, programming in Construct becomes a breeze!

  • You are not storing anything in the array, you are basically only using it to count from 0 to 5. You can do the same with two nested "for" loops:

    For "x" from 0 to 5
    For "y" from 0 to 5
    .. Create maptile at (loopindex("x")*maptile.Width)+100, loopindex("y")*maptile.Width)+100)
    

    Or simply place all maptiles manually in the editor and iterate them with "System for each" loop.

  • A tilemap is generally better. But your tiles are huge, which means that with 5 tiles the full image will be pretty big (2048x3072px). According to Ashley, it's not recommended to exceed 4096 pixels in either dimension in a single texture.

    So don't add more than 6-8 tiles to the tilemap. Or better yet - compose the backround from smaller images.

  • "Enemy On Collision with Mine" event picks one enemy instance. You can't pick other instances in the same event, unless you use "System Pick All" condition.

    For example:

    Enemy On Collision with Mine 
     System Pick All Enemy
     Mine has LOS to Enemy -> Deal damage to all enemies in range
    

    Another option is to call a function, which will pick the enemies in mine range:

    Enemy On Collision with Mine -> Call MineDealDamageToEnemies(Mine.UID)
    
  • I find chatGPT quite useful for scripting. While it doesn't know much about the Construct API and often makes up things that don't exist, if you give it the right information, it can produce working code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't understand the purpose of the array. Your array is empty and you don't fill it with any values!

    To fix the bug, add "For each maptile" in event 32

    + maptile: Is discovered
    + System: For each maptile
    + maptile2: id = maptile.id
    + maptile3: id = maptile.id
    + maptile4: id = maptile.id
    + maptile5: id = maptile.id
    

    Also, instead of linking by id, use the hierarchy feature, it will make things easier. And families.

    Player movement events are also very inefficient. Instead of re-calculating the id on every step, simply check which tile the player is overlapping.

  • LineOfSight can pick multiple instances. If you need to process them one by one, use For Each loop. You can add another parameter to the function - the amount of damage to deal, based on the distance.

    Mine has LOS to Enemy
    For Each Enemy : Call DamageEnemy(Enemy.UID, 100/distance(Mine.x, Mine.y, Enemy.x, Enemy.y))
    

    Also, you don't need LineOfSight check in "Enemy On collision with Mine".

  • Don't use expressions like distance(Player.X, Player.Y, Enemy.X, Enemy.Y) without picking the enemy first!

    And you don't need distance() at all if you have "Line of sight" behavior. Just configure its settings correctly:

    You can also add several "Line of sight" behaviors to Player sprite with different settings. For example one for detecting enemies at short distance, another for long distance, another that ignores obstacles etc.

  • Use "Set vector" actions. But you can't set a vector higher than the maximum speed, so you might need to temporarily increase max platform speed.

  • You can past multiple objects. If they are all sprites, you can add them to a family and paste in one action.

    The second option sounds intriguing but wouldn´t it just take the "low res" screenshot then and scale it up to the bigger resolution, making everything blurry?

    Well, Construct isn't really suited for this task. You can zoom everything in before pasting on the canvas if you want to make a higher quality snapshot.

  • You can instead use a drawing canvas with fixed resolution and paste the images on the canvas. Say, set canvas resolution to 500x500, resize it to the image size, then paste, then use "DrawingCanvas Save Image" action. The resulting PNG should be 500x500 px.

    Or, if there are too many objects to paste - make a snapshot, load it into a sprite, paste the sprite onto the canvas.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 259 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
  • x5
    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