How do I get my colour mixing game to work

Get help using Construct 2

Post » Sat Nov 29, 2014 7:42 pm

Hello again, guys.
I figured I should post my work in progress question as I'm having quite lot of problems with it.
I'm very new to Contruct and programming in general, having only been experimenting for a couple of weeks now.

Would you lovely people have a look at this:
https://www.dropbox.com/s/lpzq2hm2ca4kda1/QBZ2_WIP.capx?dl=0
(URL edited after confusion in following posts)

The basic idea is to grab one of the little coloured box characters and drag it to the blue 'den'. The graphics are a little work in progress too, so forgive me.
After dragging TWO coloured blocks into the den, I want them to mix in RGB format.
This is where I've come unstuck.
I just don't know how to do it.
As you can see, by looking at the code, I have an array that stores the 'tint' values of each of the blocks onscreen.
It's not finished yet, but I really don't know where to go next.
Grabbing the three values of RGB from the array and adding them to the other block in the den, simply colours that block the same colour!
That's not right.
I've also realised that my way of doing things isn't gonna work well because I'd be left with only 4 combinations!
Once I've added the red, green and blue, I'd be left with white and each array element would be 100. Therefore, no where else to go.

I hope someone can help me out with this.
It started as a simple idea in 'coloured block collecting' and ended up much more of a challenge that I envisaged.

Also, is my programming ok? Can it be cleaned up at all?
Like I say, I've very new at this and what you see here is two weeks or so of learning.

Cheers.
Last edited by Peej42 on Sat Nov 29, 2014 9:07 pm, edited 3 times in total.
B
7
Posts: 33
Reputation: 341

Post » Sat Nov 29, 2014 8:21 pm

I cannot open it. You need to save the project as a single file if you want to share it. The extension has to be .capx.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Post » Sat Nov 29, 2014 8:32 pm

Oooops, sorry.
I think it's there now.
First time I've done this so.....

Anyway, it should be there now.

https://www.dropbox.com/s/n5c84yuug68lw6d/QBZ_WIP.capx?dl=0
B
7
Posts: 33
Reputation: 341

Post » Sat Nov 29, 2014 8:40 pm

What am I supposed to do? Nothing is happening when I run the project, I only see the layout but that's it.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Post » Sat Nov 29, 2014 8:53 pm

I have no idea what happened there. I've just run what I uploaded and it was just wrong!
I've tried again and tested it this time. It's ok now.

Basically, the idea is to grab one of the coloured blocks and drag it to the large pale blue square. This will eventually be the 'combining den'.
Grab another and drop it to the same place.
Press the 'combine' button and the two coloured blocks should mix together after a short wait.

The combing isn't working as planned and so I've put this post on the forum in the hope I may get some help or better way of accomplishing what I set out to do.

https://www.dropbox.com/s/lpzq2hm2ca4kda1/QBZ2_WIP.capx?dl=0
B
7
Posts: 33
Reputation: 341

Post » Sat Nov 29, 2014 11:56 pm

Your events look a little complicated so I've made a new event sheet with how I would do it and you can tell me if this is what you wanted to do or not.

I've made a new event sheet, if you want to use yours, just change back the event sheet that the layout uses.

I've tried to make what you described, you can drag the blocks into the den and when you press spacebar (the button wasn't working for me) they get destroyed and a new block appears with the combined tint values of the previous blocks.

Also, Construct 2 already has a system to save/load, just use the save or load actions: https://www.scirra.com/tutorials/526/ho ... -savegames
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Post » Sun Nov 30, 2014 12:46 pm

Where can I download your changes?
Cheers
B
7
Posts: 33
Reputation: 341

Post » Sun Nov 30, 2014 12:51 pm

I forgot to upload it.
You do not have the required permissions to view the files attached to this post.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Post » Sun Nov 30, 2014 2:08 pm

Wow, that is impressive. Your solution is so much more compact than mine!
The combinations of coloured blocks works very well but still leaves me with a problem of what would be considered a short-coming in my original idea.

How, for example, does one make pink?

There's definitely very few combinations that one can achieve, especially considering how each RGB value has 0 to 100!
B
7
Posts: 33
Reputation: 341

Post » Mon Dec 01, 2014 10:16 pm

You can make pink by combining the red and blue. Red = 100, Blue = 100

You can modify the tint values at the editor and see the results in real time, it will give you a better idea what values you need.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 34 guests