InDWrekt's Recent Forum Activity

  • That all depends on if you want the game to randomly choose the image each time, or if you want it to choose the background in a specific order.

    If you want to make sure it specifically cycles through each background in a specific order you will need to store the last bg used in a variable on the computer and update it each time the game runs. If you do this, you would have an event on start of layout to load the information and select the next bg in the sequence.

    If you just want a random background (and this is the easier solution) you would just need to create your background objects, and use the random(N) function to decide which to use.

    In both scenarios, you would use a global variable contained in an event sheet, which all scenes had access to, to store the background you have currently selected. You would set this variable on the first scene and and all the other scenes would just reference it to properly set their bg.

  • Instead of using a static value to represent each and every action, use instance variables to represent which version to display.

    I am assuming the list above of boy number and direction is what you name each of your animations.

    Use a variable to store the selected boy number: BoyNum = 1

    Use a variable to store the selected direction: BoyDir = "up"

    Then when setting the animation set it to: "boy" & BoyNum & BoyDir

    The above will result in the "boy1up" animation being played.

  • You could do it easily using an array. Use the array to keep track of the position of all the sprites on the board. Then, when the piece is dropped into place, test the array values. See the attached example.

  • For uploading, You can attach your file to your post here (if it is smaller than 2 MB). If it is larger, most people here seem to prefer dropbox. It is the most common though it isn't the only method.

    You are most likely correct that it is a collision between top and bottom. You could test this easily simply by turning off collisions on 1 or the other. It could also have to o with collisions on background items. If your character spawns inside a solid object or gets pushed into one, it will be pushed out. This could lead to being pushed into another causing it to be pushed more.

    If you find that it is caused by the 2 separate sprites, you can do a couple things to fix it:

    Option 1 - if you can get by with only 1 of the 2 character parts having collision, than remove it from the other. This will stop the glitch and still allow both sprites.

    Option 2 - you can create a controller object which handles moving the character around and pin the character sprites to it. In this option, you would remove collisions from the character sprites and allow the controller to handle it.

    Of course there are other ways to fix this but these 2 are simple and should resolve your bug. Good luck with your project.

  • Check the example EgoAnt posted in this other topic:

    He has 2 turrets, each with a different allowed angle of rotation.

  • I found your previous topic and downloaded your file. When I run it, I see both layouts counting up at the same rate. Starting on layout 1, the text begins counting, when I swapped to 2 it takes up the count right where I left off. I don't see the NaN result. I ran it in Chrome, FF and IE11. It ran fine in all 3. What browser are you using?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • NaN means Not a Number. You will want to make sure the 0 is not "0". If it's wrapped in quotes, Construct would try to store a text value, not a number value. Hence the NaN result.

    If that is not the case, I would have to look at your capx to help further.

  • Here is something you can do to make your program a little less CPU intensive:

    1 - When a target is found, set a couple variables to store the targets X and Y.

    2 - If the target is outside the attack distance of the object with the PF behavior, run the PF behavior to get the original path.

    3 - Every second (or any time length you feel works best with your setup) check the targets position against the oiginal X and Y to see if a new path needs to be found (set an acceptable margin of error so if the target is say 10 pixels away from the origin, it still counts as in the origin)

    4 - If the target has moved far enough, run these steps over again.

    This will keep the PF behavior from triggering every tick and allow your characters to each find their own path.

  • Add a Global variable which stores the time the layout starts. On start store time in it and use the following equation to set the time text:

    settext(int(time - LayoutStartTime))

    [attachment=0:29slsrju][/attachment:29slsrju]

  • The size of the text object is too small. Stretch it out.

  • Only give the family that has ALL the bug types the behaviors you want them ALL to have. If the 1-5 family has the behavior, all the objects in the family have the behavior so adding the behavior to the 1-3 and 1-4 types is redundant. You would only use the lower level families to spawn the bugs while the higher family would do all the processing.

  • Use zeropad(Value, N):

    3. Append seconds: zeropad(seconds%60, 2)

    zeropad adds 0s to the front of a number until it is N digits long.

InDWrekt's avatar

InDWrekt

Member since 19 Sep, 2011

Twitter
InDWrekt has 7 followers

Trophy Case

  • 13-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies