lionz's Forum Posts

  • There are lots of ways to do it, depends on what is best for your game. If you are detecting whether object A is on the left or right of object B you can say if the x of object A is greater or less than object B, then based on that outcome, spawn object type C.

  • System expression len('text') returns the number of characters

  • The issue is likely to do with your idle events on line 9, you will need to also add a condition 'space is NOT down' so that it does not keep playing the idle animation instead of the shooting one.

  • I'm not really understanding the post but is there any reason why you can't compare frame to the last frame of the animation?

  • If you need to toggle something on/off use a variable, which is what you needed here. Use a function if you want to perform an action where you're going to be using it a bunch of times, passing variables through it as parameters and also may want to return some values at the end, such as if you wanted to attack an enemy with some damage you could run a damage function once to pass through some player stats, run some calculations in the function that result in an amount of damage returned at the end. There aren't really any limitations, just call it when you want to run something once but often and don't nest loops inside it. They are good for making your code more efficient and also for being able to track what is going on if you encounter bugs.

  • Great, I'm glad it's resolved :)

  • Yeah it shouldn't be looping, you should just land once and it plays once, something is wrong with your sprite. Check the collision box I suppose but it looks like your character is constantly in a fall state and doesn't quiet connect with the ground.

  • When the player lands do you hear the sound 'jumpland' ?

  • This could be promising but the 'core mechanics' video only shows moving left to right across the screen and some talking, where is the rest of the gameplay?

  • Hiya, the trigger once sounds redundant and I think you've put it in the wrong place. This sounds like it should work though, when you say won't stop falling do you mean it keeps playing the fall animation? If you share a screenshot of the events it may be come obvious as to why it's not working.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yep, no problem. ^^

  • Hiya, putting a loop inside a function isn't a good idea as it just calls it once. I've made an example here using a variable which works, take a look.

    dropbox.com/s/7pe3c9vakbxh875/array-inventory-animation-frames_edited.c3p

    notes: borrow the logic but do not use the file going forward as I deleted some layers to allow editing, note that I used 'array.width' which is the number of X values in the array and I used 'loopindex' which is the current number of loops

  • The layers aren't global but the objects are. A bunch of objects in the Moving Objects family placed in the level are set to global with the tickbox, especially obj_docks_objects_01. That's also why cutting the code down won't have an effect, you need to uncheck the global setting in object properties as the problem is with the objects.

  • What are you trying to change?

  • I would use logic such as on overlapping/collecting penguin, set a global variable itemPeng=1

    Then when you get to the final screen, you compare everything that is set to 1, if itemPeng=1 then make the object peng on the final screen visible.

    This allows you to have the final screen setup in a way where all items are already displayed in the boxes where they should be but made visible/invisible depending on if you have collected it. The global variables allow you to steer clear of using global objects, persist behaviours and instance variables that can become unreliable when used for something like this.

    If you want to get a bit more complex and you're displaying them in the order that they are collected in the game then it kind of becomes a real inventory system. Arrays are good for this, as one is collected you 'push' the item to your inventory array which is a list of items. When you reach the final layout, each object would be displayed according to their position, so the first space is 0,0 of the array, second space is item at 1,0, third space is item at 2,0 displayed in the order they were collected.

    There are a few ways to handle this, just better not to use the method where you are pulling the actual object through the game with you, I would use global variables for a simple method, and an array for a more complex approach.