tgfcoder's Forum Posts

  • Hear, hear! Great work.

  • +1 I pretty much always use functions in any project of meaningful complexity and having the editor help with that would be a great feature.

  • There isn't much in C2 that is specific to this problem, you could look at answers on SO for ideas: http://stackoverflow.com/questions/2799 ... illiard-ai

    With some maths you can work out some shot angles to try, e.g. hitting off the wall to hit the target ball if there is something in the way. How do you tell if there's something in the way? You can use the algorithm for the distance from a point to a line segment to see if it is less than the radius of the two balls added together to see if it is 'in the way'. Use it to check against every other ball on the table and if none are in the way then it's a clear shot.

    If you're using Physics behaviors, I'm not sure if you can predict the outcome of a shot meaningfully. However, for an OK AI you don't need to be perfect. Trace angles and use geometry/physics to get an approximation of what will happen and use that to score the outcome of a shot. http://i.ytimg.com/vi/QXsfwLFX4iI/maxresdefault.jpg shows a kind of example of what you have to take into account: where the cue ball will hit another ball, and the angles of both those balls afterwards.

    In short, I don't think there's an easy way.

  • I've been having this same problem and have fixed it by setting "Use high-DPI display" to "No" in the "Configuration Settings" property of the project. I was noticing in the preview that with "Use high-DPI display" and "Fullscreen in browser" set to "Off", the whole frame seemed to have shrunk inside the already shrunk viewport, so essentially things were being rendered smaller and in different positions to where they should be, leading to the unable-to-click-things bug.

    My test project where I had a sprite follow the mouse looked like this, when my mouse was actually over the whale:

  • One way to get a similar behavior is to use an instance variable and call it something like VectorX. Then, have two conditions:

    So what this does is store your platformer VectorX in the instance variable, and use it when you're jumping/falling as a constant left/right speed until you land. You'll have to manually make the animation face the right way though since you'll still be able to "turn around" but not change your horizontal speed mid-air.

    The thing with simulating left/right is that you will accelerate in the air which seems weird if you let go of everything, and the thing with this method is your jump distance will depend on your speed when you jump. With Ghouls and Ghosts it doesn't really matter because your speed is more or less constant, they have instantaneous acceleration and the jumps are always the same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't reproduce the lag, mine stays at 60fps and I played through about 20 tries. If you debug the game it shows about 6% CPU utilization, maybe something is happening in your browser or on your machine causing it to lag? I would check your debug stats too and see if you can see what might be the issue.

  • Use a boolean instance variable called "Sliding" or something like that. When you click on it, set Sliding to true. Then do another event, if Sliding is true, move it a little bit like you have now. Then every time through your game loop it will move just a bit, making it like an animation.

  • Switching to a different movement behavior may be easier for you, or doing your own custom platformer controls instead of the Platformer behavior. The other option is to generate an invisible platform just below your player's feet when you press the jump key in water. That way you can continue to keep jumping as many times as you want. You probably also want to reduce gravity, acceleration, maximum speed, and jump strength while in water to give it the right feel.

  • Make it generic by storing your labels in an Array, write a loop to find the label you want based on an expression like "score < 10 ^ (loopindex * 3)" - since every label goes up every three powers of 10 (3 zeroes). Then you can add as many labels as you want into the Array.

  • Your biggest issue will be effectively handling and storing your game data once it gets to a certain size. I find data structures in C2 to be very rudimentary but you can make it work.

  • One good way of handling modal UIs is to group actions that handle different "layers" into different event groups, and disable/enable them depending on what is showing. So if you have events for your main game, you disable them while the pause menu is showing, and re-enable them when you close it, for example.

  • I would double check that Change = 0 and nothing else is changing it. Btw, you can drag those conditions into one event if it makes it neater. These events works for me as an example:

  • What do you mean by adding strange values? Maybe your event is firing multiple times per click?

  • You would probably have to use Custom obstacles for the Pathfinding behavior, and have invisible obstacles all over the screen, so that when you place a path, those obstacles get destroyed and you can regenerate the obstacle map around the object. Because what you want is basically to specify where the object can move but the Pathfinding behavior only allows you to specify where it can't go.

    Here's an example: https://www.dropbox.com/s/85nsk1k5u3z8wrb/Path.capx?dl=1

    Use the left mouse button to place paths and click the right mouse button to move the character.

  • Assuming you're using X/Y dimensions of your array:

    Something like this should work. The second condition is System > Compare two values