SoldjahBoy's Forum Posts

  • You will need to make your own particle emitter if you want more specific control over particles.

    I rarely use the particle object built in with C2 - I almost always make my own.

    All you need to do is create your dust particles at the feet of your character when you want them to be there (IE player is running at speed greater than 100, or whatever) then you can make them rotate, fade, resize, float around, etc. Just be sure to add your own way to destroy them after a while, or they will clog up your RAM/CPU usage.

    ~Sol

  • : Your idea would work similarly to mine, but I think it would also encounter the same problem.

    I think the problem is that the weapon wheel is probably on its own layer with a (0,0) parallax, right? So unless you're in the very top-left of the map, the mouse is actually really far away from the wheel's center, and any movement only means a tiny change in angle.

    Meanwhile, looking at absolute x and y, it seems like that refers to the mouse position for the entire screen, not just your game's window. Possibly not a problem once you port to mobile?

    So a potential workaround: you could use (mouse.x, mouse.y), set the weapon wheel's layer to a (100,100) parallax, then set the wheel's position to (scrollx,scrolly) every tick. It does make the rotation work correctly. However, you would have to put your onscreen buttons in a separate layer or move them every tick as well. This method also makes the weapon wheel look a bit jumpy when it repositions, but it'll only be visible when the timescale is very low, so it might not be noticeable.

    If you want to track the mouse from a layer that has parallax, that's what LayerToCanvas and CanvasToLayer is for

    You can move/relate things on different layers with different parallax values using these expressions

    ~Sol

  • You need to drag it with your mouse and drop it ABOVE the main event that it's "indented" under. It's a quirk with the drag and drop system - for some reason it will only "un-nest" itself when dropping it above.

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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