dop2000's Forum Posts

  • You can use Keyboard.StringFromKeyCode expression. Code for A is 65, code for Z is 90.

    Or create a string variable with all letters and use mid()

    alphabet="abcdefgh...."

    to get 5th letter: mid(alphabet, 4, 1)

  • Man, your game has seriously cool graphics! Great job!

  • Holiday, I actually found that capx here on the forum.

    Thanks, R0J0hound !

    You example does work a bit faster. I have an old Android mobile phone that I use for performance testing and it's showing 45-50 fps. (about 10 fps more than with particles)

    Unfortunately, the Subtract effect is still quite slow on mobile. When I add two big gradients like that into my game, fps drops from 50-60 to 20-30...

    So I think I'll have to use particles, but lower quality.

    If I make the image smaller, significantly reduce the rate and fade out time and move them closer to the borders of the screen, the fog looks good enough and only costs 2-3 fps.

  • Wow, you must have spent a lot of time on those animations!

    I made quite a few changes, have a look:

    https://www.dropbox.com/s/jxpek2uoap2pb ... .capx?dl=0

  • System -> For each (ordered) , object: Sprite, order by: random(1)
       Sprite set animation frame to: loopindex
    [/code:1t3be6dm]
    
    Also make sure to set animation speed to 0.
  • x=0.666666666

    Set text to int(x*10)/10

  • angle(Player(0).x, Player(0).y, Player(1).x, Player(1).y)

    Or you add two temporary variables tempX, tempY, pick the first Player instance, set tempX=Player.X, tempY=Player.Y

    Then pick the second player instance and use angle(tempX, TempY, Player.x,Player.y)

    Or you can create a family with Player object, then you'll be able to pick Player and PlayerFamily in the same event and do angle(Player.x,Player.y, PlayerFamily.x, PlayerFamily.y)

  • Ok.. If I understand you correctly, the first bullet kills the zombie. Then the zombie starts playing "Dead" animation. If you shoot again, the second bullet should fly through the zombie (not collide with it). Is this correct?

    You can disable collisions after the first bullet and disable Platform behavior for the zombie.

    Or you can check if animation "Dead" is playing on bullet collision:

    Bullet on collision with Zombie:

    and Zombie animation "Dead" NOT playing (right-click and invert this condition)

    ...Bullet destroy

    ...Zombie start "Dead" animation

    ...Zombie set collisions disabled

  • What is your native language?

    It may be easier to understand you if you use Google Translate.

  • Gamepad object has a few expressions, you can use them to check gamepad buttons and axes state in System-Compare values event.

    Gamepad.Button(Gamepad, Index)

    Gamepad.LastButton(Gamepad)

    Gamepad.Axis(Gamepad, Index)

    etc.

  • I need an effect like this:

    https://www.dropbox.com/s/fuvcgcj1qfrfz ... .capx?dl=0

    But the problem is, within 10 seconds as more particles are created, the FPS drops significantly, especially on mobile.

    Is there another way to make this random fog/smoke, which does not affect the performance?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use & and | operators to make this condition:

    System-> Compare two values -> ((x = 1 & y = 2) | (z = 3)) equals 1

    Of course if you need to compare things like "is overlapping" or "is mirrored", you can't use them in the formula.

    In this case you might need to add a local boolean variable and do something like this:

    Sprite1 overlapping A

    (and) Sprite2 overalpping B -> Set tempBoolean to 1

    tempBoolean=1

    OR Sprite3 overlapping C -> do things

  • Here is the formula to get the angle in 0-360 degrees range:

    a=(Player.8Direction.MovingAngle+360)%360

    If you want to have just one formula, I guess you can do something like this to get numeric value 0-3 for player direction:

    d = (a>315 | a<=45) ? 0 : (a>45 & a<=135) ? 1 : (a>135 & a<=225) ? 2 : 3

    Then set animation frame to d.

    Or you can name your animations "A0", "A1", "A2", "A3" and set animation to "A" & d

  • If your question is about organizing data, you can do this with multiple array instances.

    Create a separate instance of the inventory array for campfire, box, backpack etc.

    To know which each array instance is for, add an instance variable "InventoryType".

    Then insert as many elements as you need.

    Or you can make an array of arrays - "master" array that stores UIDs of all "secondary" arrays.

  • I don't think there is a better solution other than comparing the angles and changing animations.

    System-> Is between angles -> Character.8Direction.MovingAngle between -45 and 45 : Character set animation frame 0

    System-> Is between angles -> Character.8Direction.MovingAngle between 45 and 135 : Character set animation frame 1

    etc.