Having little problem. Can you guide me?

0 favourites
  • 6 posts
From the Asset Store
You can become a REAL game developer. Learn the basics and get resources that will let you get profits from your game!
  • Hi im working on a prototype which I intend to convert into a full game. This is my first project after doing basic tutorials. Im having some small issues and im hoping someone will be kind enough to help me out. Below is the dropbox link to capx file.

    dropbox.com/sh/vlebjkv5byrlvc5/bguA-kc8xi

    Im having 2 problems in this

    1. When I click on second echo the key becomes visible but doesn't disappear with it. The effect I intend to create is that the key is only visible when echo happens. Iv tried making it invisible after fade effect is over, destroy it and respawn it but it doesnt seem to be working right.

    2. When the character falls in the pit I want to show Game over text but im not able to do it. The text works when I try on level clearing but doesn;t on game over. What am I doing wrong?

    I hope someone will be able to guide me. Any feedback is also welcome.

  • Hello Killermachine, I have fixed the Capx for you. Here is the link: dropbox.com/s/h4u8vp0v24y141d/Sonic%20Game%20Fixed.capx

    Here is what you have to do to recreate my fix:

    On the 1st issue, put the key visible and start fade out on the same event as the "Echo 2 Click" event.

    On the second issue, you are testing for the wrong thing. You should just be testing for player is outside layout. Then set the gameover text to visible and destroy the player.

    You were originally testing if the player was on the ground, and then if they were not on the ground. You can't have both of those be true at the same time. So instead of doing all that, just test to see if the player has gone outside the layout.

    For the other issue, you were setting the visibility of the key based on the visibility of the echo. The echo is visible the whole time till it is done fading out, which means that the key keeps get set to visible and starting it's fade over again until the echo is gone completely. Instead of doing this, I just add the key visible and start fade to the Echo 2 click event.

    Another way to do this to make it more flexible would be to just have an event on the key that checked to see if it is overalapping an echo object, and if the echo object is visible. But you may get the same odd behavior you had before so I would just stick to the way I fixed it in the capx file unless you need some altered behavior. So there is an action somewhere (I forget the name) that tells the event to only happen once, you could look for that as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Apart from the fact that your super clean capx made me kind of jealous of your prowess with construct, I'm really thankful for your help.

    On issue 1, I intend to make different types of echo's working the way sonar works(as in like moving effect) so I may need your help again but for now this will work well. I will try your suggestions just to understand what will other things achieve. They may prove useful later.

    For issue 2, it was silly of me not to consider that avenue.

    Thanks once again :D

  • Ok I'v tried really hard but im stuck on an alternate behaviour of echo. I tried my 2nd sound echo in wave style. The only thing happening right is wave animation. The part where the key should become visible when the wave overlaps it or collides with it is not happening. I tried the overlapping method told above by BluePhaze but its not happening.See layout/event sheet 2

    dropbox.com/s/gql2gpac68wblmp/sonic%20game%20proto.capx

  • No, problem, glad to help. I have been using Construct 2 for a few weeks, so still not intimately familiar with all it's inner workings, but my development background tends to come in handy for figuring out how to resolve issues with game play mechanics in C2.

    I tend to try to find the simplest solution in order to avoid having the underlying code check for too many things at once as any unnecessary calls could potentially slow the game down.

    I haven't had time to look at your updated capx, but if you don't have an answer by the time I get home tonight (pacific time U.S.) I will take a look. Though that won't be for a good 12 hours.

    The problem off the top of my head is that you need to detect which echo has been clicked then have the key display. You may want to do something like have the key check if the nearest echo is visible. And if it is, then go ahead and set the key to invisible and start the fade. You could also do something like create a variable, and when clicking on the echoes have them set that variables value, then you can have your key check the value of the variable, if it is set to the value you want (maybe true/false type value Boolean) then if it is true have the key set it back to false, turn visible, then start its fade out. This will keep it from having the same issue you had before where the fade would keep repeating.

    So something like this:

    1. Have the Echo check if it is overlapping the key when you click it.

    2. If the echo is overlapping the Key set the variable (overlapKey) to true (make sure the variable is set to false when it is created).

    3. Have an condition that checks if "overlapKey" is true, Set it to false, set the key to visible, and start fade out. (Setting the variable back to false is key here as it makes it so the key does not keep repeating it's fadeout).

    At that point the key is ready for the next echo event to happen. You have also eliminated having to tell it which echo is the right one as the echo will take care of that for you in it's check to see if it is overlapping the key. You just need to have each echo make that check when clicked on and set the variable accordingly.

    Hope this helps!

  • Im sorry for the late reply. The problem is slightly different as this time the echo is more animated. I think I was not able to explain properly.

    If you take a look at the layout 2 in the capx you will see thst this time Im using frame animation to show movement of the wave going from the source till its end like this [(((((o)))))] instead of the original echo design. The Key shows up when the animation starts(or when I click the button) but the wave has not reached it visually. The key needs to become visible when the wave animation frames actually overlap it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)