paulscottrobson's Forum Posts

  • I am working on a Match 3 game http://myconstruct2dev.blogspot.co.uk (source in github) which is not totally dissimilar. The problem is it is recursive - red touching red touching red I think, so you need some sort of array of current colliding colours, then when you scan through it check it's not already in the array, otherwise it could loop around for ever

  • Families are quasi classes. You can put an object in a family and it sort of treats them generically, so you can do things like have different ships and common code. It doesn't really do what you want though, it's a bit limited and it's not easy to change after the effect, but it can be useful.

  • Have a look at my blog http://myconstruct2dev.blogspot.co.uk/ which has several in the github, the best explanation of the code is probably in the asteroids post.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sort of. Your game has no real ball trajectory, it is like my cricket game. I think personally it is sufficient for most games. The aim of a cricket or baseball game is to be fun to play, not realistic.

  • When you say "black screen" I presume you mean the browser here. I would set it up so it displays the javascript console log (how depends on your browser) and see if it is spitting anything out.

  • Have a look at my Asteroids code http://myconstruct2dev.blogspot.co.uk/2 ... roids.html which has source code in github and explains how it works - and this one does work. You have probably got your sequence wrong.

  • "Several exporters, e.g. for mobile or desktop publishing, are unavailable"

    Having looked at the list of stuff missing from the licensed version (I didn't use the free version for very long) I think it would drive me nuts. C2 is dirt cheap for what it does. (GameMaker for example, if you want to export to anything other than Windows is $550 and that's a special offer, GameSalad is $200 a year).

    Some of those that claim to be 'free' aren't actually free. The business thing is also very generous, AFAICS they are identical except if you make more than $5k you have to spend another £180 or so. Which isn't a bad exchange

    Seriously, I would give thought to buying if only for families and effects and stuff.

  • Depends how much accuracy you want. You may expect a fielder closer to the batter to stop the ball if it is hit right through them, and not to aim to move for the terminal position but some way between the two.

  • You can also calculate it directly by set Y to Object.Y + OBJECT_VERT_SPEED * dt

  • I think a potential is to have an isInvalid instance variable which defaults to false. When this is true, it does not need to repaint the wall (e.g. scan and pick the animation), when it is false it indicates it needs to. You can programmatically set it to false if you need to repaint a wall for some reason (e.g. opening a passage).

    You could then have something like

    SP_001 Is on Screen:

    SP_001.isInvalid is set:

    Set SP_001.IsInvalid to False

    (Scan and reset animations)

    Might be better as a sub condition and the other way round - you'd have to experiment to find out.

  • Have a look at my asteroids source in github - the page http://myconstruct2dev.blogspot.co.uk/2 ... roids.html decribes it.

  • You can't really. It's mathematics.

    The simplest way of doing it is probably to calculate where it ends up, then get the nearest fielder to that end point to move there, catching it if the ball is off the ground just before it lands when it rolls. This works quite well for cricket, but cricket is different in that a lot of shots are along the ground anyway, and it means a fielder cannot intercept the ball on its way to the target area.

  • Pretty much as you say

    Enemy.OnDestroy:

    System.compare2Values random(0,1) < 0.6 : (Action 1)

    Else : (Action 2)

    C2 is mostly event driven ; so it isn't really "if enemy destroyed" - it's actions that are executed when the enemy is destroyed.

  • You can improve the inertia thing using the standard velocity equations in 3 directions - it will be near enough. You only need precision for flight simulators (and then they are just better approximations)

  • It is quite complicated. You have a straight line which is the ball trajectory after hitting it and you want the shortest right angle distance to that line, but eliminating anything that isn't catchable (e.g. above about 7-8 feet off the ground). There are probably some maths equations online that will solve this.

    You can probably break it up into approximations. Standard equations will generate the trajectory of the ball from the impact of bat on ball and you can calculate it every couple of metres or so, working out if the fielder (do the basemen chase the ball ? English !) can get to that point in the elapsed time.

    The problem is a human instinctively knows whether they can catch or get a ball or not, or someone else is better placed to do so.

    Having written several cricket simulators over the years (a similar hit bat with ball and fielders game popular in the UK and other countries) it is very difficult to realistically simulate a swinging bat versus a moving ball accurately. Baseball is worse because the bat is round. Generally you cheat Most games rely on lining up and timing to determine where the ball is hit. Accurately simulating a pitchers behaviour "trying to trap a batsman" is even worse.

    The thing to do is make it fun. Stick Cricket for example is absolutely awful as an accurate simulation of cricket. But its fun.

    Someone from India (play cricket a lot there) asked me about this professionally, how do you accurately simulate the effect of bat on ball ; I suggested they don't, make it approximate, make it fun.