Aquanex2's Forum Posts

  • Aquanex2 So I've created another way to create "movement that follows a specific path". I'm using bullet behaviors with invisible sprites that change the bullet speed and bullet angle of the player. I experimented and came up with 3 different ways to create movement along a path. I'm using the pathfinding behavior, the rex spline behavior and the bullet behavior. Take a look at my capx! I'm pretty happy with how it came out. Just need to add a reverse function to it now. I'm not moving a "platform", I'm moving the player but I imagine it'll be easy to change.

    Gmoney I modified your spline example to suit purposes. I want to move the player along the spline path when they collide with the object that travels the spline path. When the player collides with the object, they'll be pinned to it and the path function will run. I'm having a few issues. For some reason the zipline object on the path moves right at the start of layout. When it's being ridden, the zipline will actually leave the screen instead of stopping at point B. I'm unsure how I stop the ride and "disembark" the player and end the function. Would a sprite that unpins the character do that? Here's a gif of how the spline behavior is working.

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

    That's really neat! Nice job! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Yes, because the Localstorage plugin will save data just the way how our usual save games are stored.

    However, if the data is saved locally, they'll disappear once user deletes cache. (I'm not sure if cache is the correct term, but locally saved game files always disappear whenever we go to web browser's privacy section to remove cache and other details.)

    That means the user will have to start from the beginning again, after the local files get wiped out.

    If the game is going to be an epic scale, I would recommend you to store the data remotely on a server, so users can access their saved data no matter what happens to their local save files.

    Setting up a remote save feature will need other things such as finding a good web hosting provider, setting up a database, handling configurations, etc.. though.

    And that's a.. completely different beast. <img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very Sad">

    https://www.scirra.com/tutorials/4839/c ... sql/page-1

    local-storage-through-mobile-browser_t165787

    I think I've finally figured out what I need to do!

    Thanks, Gmoney! You've been a big help!!! I am eternally grateful! <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green"> <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green"> <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

  • The star status then must be stored via LocalStorage plug-in.

    https://www.scirra.com/tutorials/1461/h ... age-plugin

    The player won't need to play the levels played previously, nor need to collect all the stars again; even after closing the game and re-opening it later.

    In my game, you play a level and get all the stars you find, then go to the goal. The level select shows you how many stars that you've gotten on each stage, so you know where you missed some. If I use localstorage, will I be able to make it so that any stars you get will be gotten, forever, even without using something like the persist behaviour?

  • 1. Make a global variable Totalstarscollected = 0.

    2. When Level 1 ends, add a system Event to add TotalStars variable's number to Totalstarscollected.

    3. When Level 2 starts, reset TotalStars variable.

    4. When Level 2 ends, add a system Event to add TotalStars variable's number to Totalstarscollected.

    5. When level 3 starts, reset TotalStars variable and so on.

    6. After all the levels are cleared, Player will be able to see how many stars were collected in total, by observing the Totalstarscollected variable.

    What if I want the player to be able to replay levels and get the same stars without adding stars that they already got?

  • I want to make a moving platform that follows a specific path that I'll set. How would I go about doing that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have added the following features.

    1. Added a 'Level Select' button.

    - When pressed, a Level Select screen will pop up to show how many stars are remaining.

    - When discarded, the game will continue just the way you left it, right before entering the Level Select screen.

    2. Added a feature to allow the Player who hasn't finished the level to restart without having to reset the number of stars remaining in game.

    - Previously, when the Player reached the goal without collecting all the stars required to finish the level, the number status of the stars had automatically reset.

    - What happens now is this. If the Player hasn't collected all the required stars, the Player will restart from the beginning of the level. The Player will notice only the remaining number of stars are in game and the ones s/he collected have disappeared.

    By the way, I have downgraded my Construct 2 version to 233, because other people who I helped on the forum advised they were also using 233..

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

    I want the Totalstars variable to add together all of the stars from all the levels. How would I do that while keeping the same code?

  • You mean like this one? <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

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

    Game complete scenario

    1. Added 2 more stars.

    2. When all 5 stars are collected, the level clears.

    3. Player is taken to the 'Complete' layout.

    4. The message shows 'Collected all 5 stars! You have finished the first level..!! Click to reload the level..!!'

    5. When clicked, the player is taken back to the first level with 0 total stars.

    Game incomplete scenario

    1. When player collects less than 5 stars and jumps into the goal, the player is shown a message that says 'Please collect all 5 stars. Restarting.'

    2. The game restarts with 0 total stars.

    I see what you did, but The object of my game is not to get the stars. It's just a simple platformer, and the stars are just extra. If you missed a star I wanted you to be able to replay the levels until you get them all, while showing you your total amount of stars on the level select.

  • From my example or from the 'after' version?

    I did, for all three capx files.

    I collected all the stars, but the level didn't clear, so I had to jump to the goal in order to restart the level.

    My example had reset the stars to 0 after I reached the goal, just like the 'before' version.

    There was no change for the 'after' version though.. The stars were not collected and the level just restarted after I jumped into the goal.

    The way that I wanted to do it is to add the stars to the total stars after you got the stars and beat the level.

  • Did you clear the level once you got all the stars?

  • Thank you for the capx update, Aquanex2.

    I've looked into the issue and found the 'after' example is not adding any stars to the StarCountArray.

    Before

    After

    Meaning there's no link between 'CountUp1/2/3' variables and 'AddStars' after the change.

    I have one more question for you.

    Why would you need an array to store number of stars collected?

    I think we can take an easier path and store the numbers directly to the variable.

    Here's an example capx I made to demonstrate.

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

    This is what would happen when I'd go to the 'Level Select' screen without clearing the score.

    1. Collect a star.

    2. Click [Go to level select without clearing score].

    3. Click [Go back].

    4. Score is still 1.

    This is what would happen when I'd go to the 'Level Select' screen after clearing the score.

    1. Collect a star.

    2. Click [Go to level select after clearing score].

    3. Click [Go back].

    4. Score is 0.

    Function and array are a superb way of organizing the overall code, but I tend to avoid them because they could be more troublesome to troubleshoot once things start to get tangle up along the way.

    I can't use the capx because I'm using version 233. It's the most recent stable beta.

    But I see what you are saying.

    The reason I used an array is because of something someone else showed me, and it seemed to work.

  • Do you have an example capx by any chance? <img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked"> I tried to make one from scratch, then figured it would be easier if you'd supply a simplified example capx file.

    Here's how it was before: https://www.dropbox.com/s/lfgmt1x6jvmt4 ... .capx?dl=0

    And Here's how it was after I changed it: https://www.dropbox.com/s/kg46pa7qari2b ... .capx?dl=0

  • Do you have an example capx by any chance? I tried to make one from scratch, then figured it would be easier if you'd supply a simplified example capx file.

    It may take a bit, but I can make one.

  • Okay. I have no idea what the issue is at this point, but this is what's been going on, and it's bonkers.

    I have an array called StarCountArray for the stars. At first, I had it set up so that after you get a star, it would set the XY value of the star from 0 to 1, then it would add the total to a Global variable called Totalstars using a Function called AddStars.

    So like this:

    On Function "AddStars" ---------------Set Totalstars to 0

    subevent -For Each XY element ---------------- Add StarCountArray.CurValue to Totalstars

    It worked like a charm, but I realized that if you got a star, then left the stage to the level select, it would still count up the total amount of stars collected, which isn't what I want.

    So I tried something else.

    Keeping the same function, I made 3 new global variables:

    CountUp1

    CountUp2

    CountUp3

    After you pick up a star, depending on which one you picked up, it would change the value of the corresponding variable to 1.

    Then I made an event for when you reach the goal.

    After you reach the goal, I have a For Each loop that sets the StarCountArray value of each star in the layout to it's corresponding CountUp variable.

    I know it sets the right values because I made 3 Sprite Text objects to keep track of it, setting their values to the StarCountArray values, and every value became 1 when you reached the end of the level.

    In the same For Each loop, after it does the action mentioned above, it does the AddStars Function to add the stars to the Totalstars variable.

    Sounds like it should work then, right? Well... No. No it doesn't. The value of Totalstars becomes 1. ALWAYS. even after I clear another level and get all of the stars on that one. The value of Totalstars stays at 1 no matter what, but only after I clear the first level. I've looked over it several times to find errors. I couldn't find anything wrong. It doesn't make any sense.

    If you read my essay of a topic, I thank you. If you think that you know what the issue is, or you think that there's something else I could try, then PLEASE tell me. I will be eternally grateful!

  • Not sure this is enough info for anyone to help you. There is probably an event or action that you don't realize is affecting something.

    That's what I initially thought, but I just don't know what it could be. I scanned the entire event sheet to see if there could be another event that got triggered that keeps him active, but I didn't see anything.

    It just doesn't make any sense to me.

  • At the end of the level I have the goal, and when you touch it, several actions take place. One of the actions is to disable the platform behavior on my player. At first I thought, well maybe I messed up somewhere, but NO! The only difference here is the layout I'm on.

    All of the other actions activate when I touch the goal, so I don't know where I went wrong. If you exempt all of the other actions it basically goes like this:

    Player -> on collision with goal ->->-> Player -> set goal to true

    Player -> When goal is true ->->-> set Platform disabled

    But it doesn't disable platform when I touch the goal. Why Not?

    Please help! :(