dop2000's Recent Forum Activity

  • Zion

    Again - in terms of performance it doesn't matter how many layouts or event sheets you have.

    Other things are much more important - the size of your images and animations, efficiency of your code etc.

    Large number of layouts will make it harder to manage your project. Imagine you have 100 layouts and decide to make a small change on all of them - this will take an hour! So if you can, you should minimize the number of layouts.

    If your code for 100 levels is basically the same, of course you should not make 100 identical event sheet.

  • NN81, You are wrong. Performance depends on implementation and not on the number of layouts.

    Of course if you dump thousands of objects from all 100 levels onto one layout, this will be bad for performance. But obviously this is not a very good technique.

    Zion

    It depends on you game.

    I'm making a puzzle game with 200+ levels and I only have one layout for all of them. My layout contains all fixed interface elements like HUD, dialog windows etc. and an empty "Game" layer.

    On start of every level I read parameters for this level from a text file (which I made in Excel), and create required objects on the "Game" layer.

    And all this works really fast

  • I think IndexOf() only works with 1D arrays, as it can't return two values for X and Y axes.

    Array->Contains value can tell you if this value exists, but to find its coordinates in 2D array you need to loop through it using "For each XY".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your function is never executed, because loopindex is always =0

    I suggest you add a large text field to your layout and use it for debugging.

    Try for yourself:

    DebugText->Append text "Loopindex:" & loopindex

  • You don't need animation frames for different angles. Just keep one frame with the ship facing to the right.

    Then use Enemy1->Set Angle action to rotate the ship to the same angle as your Bullet.AngleOfMotion

    Or you can set "Set Angle=Yes" in Bullet behavior properties and it will fly in the direction of the sprite, i.e. you will only need to change sprite angle. Bullet angle of motion will be changed automatically.

  • Your link is broken, try posting it without the "https://" part

  • luckyrawatlucky

    You mean having 2 spriter objects?

    This is what the OP was trying to avoid.

  • You have 2 instances of EF_Start.

    When you use "Pick by evaluate" event the system performs 2 steps:

    a) takes the first instance, compares if .stt=choose(1,2)

    b) takes the seconds instance, compares if .stt=choose(1,2)

    Because choose(1,2) expression generates a random number every time, this event works unpredictably. It may pick one instance, or both, or none.

  • Add Timer behavior to your Enemies and use it instead.

    On start of the layout - For all enemies start "shoot" timer for random(x) seconds (Once)

    On "shoot" timer event -> shoot weapon and schedule new "shoot" timer.

  • A ? B : C is called ternary operator.

    It basically means "if A is true, then B, else C"

    So this formula reads:

    chain.index* (IF loopindex("i")=1 THEN -dir ELSE dir)

  • I think what happens is that when you use one of the "Pick" events, the system actually loops through all instances and compares them one by one.

    So it takes the first instance, compares if .stt=choose(1,2)

    Then it takes the seconds instance, compares if .stt=choose(1,2)

    The problem is that the second time choose(1,2) may give a different number!

    Say for the first instance random number was 1 and for the second instance random number was 2. And as a result, both instances get selected and two bullets are fired!

    Here is an easy fix:

    rand=choose(1,2)

    System-> Pick EF_Start where stt=rand

    Or just use the Pick Random Instance event.

  • There may be errors in your .json file

    Could you share the project?

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 256 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