SoldjahBoy's Recent Forum Activity

  • Oooohhhh riiiight.... NOW I understand what you meant.

    R0J0 always has the easy answer though... I would have done it differently (because I'm not awesome) but my solution would have been far more complicated.

    ~Sol

  • Ah right I get you...

    Hmm... I would probably use a dictionary with keys for the things I wanted to track (ImagePointCount or DistanceToControlPoint, etc) for each object - sticking them in a container together. This way you can just reference the keys to get whatever the changing/weird value is. I find it a lot easier than messing around with arrays. I use them exclusively for every character/enemy in any game/idea/prototype as an easy way to record every obscure detail about any given instance - not to mention the ease of saving and loading as JSON, and even nesting dictionaries into a single dictionary for that specific purpose.

    I guess it's pretty much the same as you're already doing - but instead of counting cell positions with arbitrary methods, the dictionary just makes it a little more "friendly". My brain doesn't brain when I have to start using too many obscure numbers and token counts, etc... but that's just me.

    *EDIT*

    Failed to mention, regarding the original question - you can then simply do a key count on the dictionary as well if necessary for the actual amount of values.

    ~Sol

  • I don't think there is, since you don't know what the values will be until such time as you require them.

    How are you using this in your project? Can you store the last known value spread in a couple of variables (instance or global depending what they're for?) and compare those (until they're changed)?

    I'm trying to think of a situation where you would need to compare unknown values - and my tiny brain isn't coping, lol.

    ~Sol

  • My example uses a global variable to define which player is used. You simply use the exact method to create the player that I used in my example. If variable = XYZ then create object/player XYZ.

    ~Sol

  • Yeah it often is really that easy. Over-thinking things can often lead to this type of long-winded event style being made.

    If all else fails and you can't do a direct comparison between something (like in your example, animation frame and the sprite set to use) then make a variable for it and compare that.

    I have made some seriously complicated stuff happen with only one or two events - it's all about the logical mechanics used to build your idea.

    Hopefully when you create your object and set the animation frame you did it using something like "set animation/frame to loopindex" or similar. It would also save a lot of time and be more flexible

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mean like this?

    ~Sol

  • Yep.

    On touch -> selectedChampion = current.frame

    Lol

    ~Sol

  • Most people use C2 to build their own level/map editor. It's quite common practice... especially if you want your players to be able to make custom maps for the game.

    ~Sol

  • I made a custom "flocking" system in CC to stop characters from stacking on each other. If i remember correctly I made a helper/detector sprite that was slightly bigger than the characters and it would be set to the position of each character always. If the detector was overlapping another character, then he would stop moving -> else he will move to the destination. Maybe something like this will work for you as well?

    ~Sol

  • Character and enemy graphics are pretty nice. The wizard and the rock golems are especially nice. They're very difficult to defeat though - there's no good way to evade the rock attacks.

    Overall pretty cool so far!

    ~Sol

  • This is likely to get very confusing and complicated, but I will try to give you some ideas.

    For maintaining field position you could do a check for the distance between the ball and each AI player. If they are too far away from the ball then they will go to their position on the field instead. You can perhaps over-ride this if there is NO player close to the ball, you can pick the AI which is CLOSEST to the ball and make him chase it. Obvioulsy there are a lot more things to take care of regarding this - but this would maybe be a good place to start.

    You can also make shooting the ball the same... the AI player must be within a certain distance (use the distance(x1,y1,x2,y2) formula) before he/she will shoot the ball.

    Using if goal is within angle is probably a good way to do it - but you could add some accuracy changes using an instance variable for that player so it will maybe go a little bit left or tight when they shoot to give it a little more realism.

    You can also try to make the AI dodge around the player if the distance is too close. This would be a fairly complex thing to do since you would need some math to figure out the best direction for the AI to change to from it's current direction.

    Everything about a sport game is really easy to make, except for the AI. AI in a sport style game is by far the most complex part of the game - since that's really what makes the game good.

    Hopefully some of these ideas might help.

    ~Sol

  • You can use a loop and set your value/position as the loopindex.

    This will allow insertions one by one, but all at once?

    It's really hard to give an exact answer since you haven't really explained what you're trying to do... maybe a dictionary would be better? It really depends!

    ~Sol

SoldjahBoy's avatar

SoldjahBoy

Member since 2 Apr, 2008

Twitter
SoldjahBoy has 3 followers

Trophy Case

  • 16-Year Club
  • Email Verified

Progress

17/44
How to earn trophies