Combo bonus

Get help using Construct 2

Post » Wed Oct 23, 2013 8:55 pm

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     Blacksmith2013-10-23 20:55:34
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Thu Oct 24, 2013 7:56 am

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

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

B
9
S
2
G
1
Posts: 36
Reputation: 1,381

Post » Thu Oct 24, 2013 4:37 pm

@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   :)
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Thu Oct 24, 2013 4:51 pm

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 5:58 pm

@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!

:)
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Thu Oct 24, 2013 6:15 pm

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 7:17 pm

@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 :)
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Thu Oct 24, 2013 7:45 pm

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?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 8:29 pm

@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.Blacksmith2013-10-24 20:40:00
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Thu Oct 24, 2013 8:51 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests