Combo bonus

0 favourites
  • 11 posts
From the Asset Store
Combo
$10 USD
Button Combinations like in fightings, supports both keyboard and gamepads
  • Hi everyone

    I'm trying to create some combo bonuses, but I'm stuck trying to work out the best way to do it!

    I have 9 items on screen, and I want to combine x3 for different combo bonuses

    So:

    1+2+3 = combo

    4+5+6 = combo

    7+8+9 = combo

    But:

    1+2+5 = no combo

    2+3+9 = no combo etc, etc...

    I've created an elaborate and complex set of variable checks to do this, which does work! However, it seems like a very over complicated, and messy way of doing things!

    Could anyone offer a better/simpler solution to get the combo system I want?

    Thanks a lot for any help    <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Check this tutorial out... It's quite rediculous how easy he makes it seem

    scirra.com/tutorials/468/part3-basic-fighting-game-tutorial-video-series

  • Effregy, thanks for your help, and the link!

    It seems like a very useful tutorial, and danuyos is clearly a skilled developer!

    However, I'm not sure it answers my question! I'm looking for a way to create bonus scores, once a player has selected specific objects!

    So for example: I have 9 objects on screen, and if the player chooses objects 1+2+3 or 4+5+6 or 7+8+9, they earn bonus points. But if they select any other combination, no bonus points.

    I've created a check using variables (which does work)! But there are so many different combinations (especially if you add more objects), that the event sheet for the checks has become quite large and complex!

    That's why I was wondering if there's a simpler/better way to achieve what I want!

    Thanks again for the help though. I'm sure that watching this tutorial will greatly improve my skills   :)

  • should be pretty easy though,

    you could have three global variables combo1, combo2 and combo3

    on object1 selected add 1 to combo 1

    on object2 selected add 1 to combo 1

    on object4 selected add 1 to combo 2

    if combo1 = 3 set bonus

    if combo2 = 3 set bonus

    All you'd have to do is make sure the objects can't be selected more than once and/or subtract 1 when deselected.

  • LittleStain,

    Yeah that's pretty much what I already have!

    I did oversimplify my initial explanation, as I didn't want to bog down the thread with too much info!

    The problem is the event list becomes quite long when you have to check the many various combinations that exist. And that's just with x9 object, I'm hoping to have lots more!

    That's why I wanted to check and see if anyone had a better solution than using variables!

    :)

  • It's not that long a list is it?

    You want a different action for every object you touch so all those actions should be written. I'm still not sure what you mean by many various combinations, for you only speak of three.

    apart from those actions you just have three events to check the different variables.

  • LittleStain

    As mentioned, I'm hoping to have more than x9 objects in the finished project. Which means more combinations!

    Each one will be able to combine with a selection of it's neighbours (but not all will combine).

    There will also be many 1, 2 and 3 objects on the screen at any one time. So preventing each object type from being selected more than once, is not an option unfortunately.

    This means I need to check each time, to make sure that my combination is made of 3 distinct objects i.e. a 1, a 2, and a 3. Otherwise the player could just select 3x 1's, and score a bonus.

    Even with only x9 objects, there is no way to tell which order each object will be selected in. So it may be 1+2+3 or 3+2+1 or 2+3+1 or 3+1+2 etc. And all various combinations have to be checked for.

    All of these different checks start too expand the events list quite rapidly.

    So I just thought there might be a better way to do it, that I hadn't thought of.

    But thanks for the help anyway :)

  • I don't understand why you need to know in what order the objects are selected to check if the right combination is pressed.

    what is the difference between if 123 is pressed and 321 is pressed?

    it's the same combination right?

  • LittleStain,

    I need to make sure each combination is made up of 3 distinct objects, a 1, a 2, and a 3.

    Each time one of these objects is clicked, it's value goes into a holding variable.

    So if the first holding variable is 1, and the second is 2, and the third is 3 (or any other variation of those three), I then add 1 to my 123combo variable, and a bonus is awarded.

    But if the first holding variable is 1, and the second is 5, then the holding variables are all reset and the sequence has to begin again.

    There are several of each object (1's, 2's, and 3's) on the layout at any one time, and each object can be selected. This means the player can chose x3 1's in a row, if they want to.

    If I use the approach you've suggested (e.g a combo variable that I add 1 to every time one of the three items is selected). It would be possible for the player to select x3 1's, or 2's etc, and still receive a bonus. But that would not be correct in the game.

  • That can be easily prevented by using families and a boolean variable, which would save you a lot of events especially if you are planning to add more combinations.

    If you'd like me to I'll create an example tomorrow, almost bedtime here..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • LittleStain,

    I'd be happy to see a different approach, if it can help reduce my workload :)

    I was also thinking about the possibility of using an array instead. But I'll need to do a little more research on those!

    Anyway, thanks again for the help :)

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