How do I replace generated object to real objects in layout?

Get help using Construct 2

Post » Thu Oct 01, 2015 3:26 am

Hi!
I have a game thar work with boxes. Each 5 boxes are generated other 5 boxes more etc.

This boxes contains numbers ands operators to solve a mathematical operation.

The first box have a number
The second box have a operator (+,-,*./)
The third box have a number
The fourth and fifth boxes contains a possible solution numbers for the equation.

Image

Image

This boxes pertain a world with obstacles, but as are generated by command (create object), i dont know the specific position where will be created in layout, for that reason, when i put obstacles (sprites) on layout i should to run the game to see if the box was generated in the correct position.

actual layout with boxes ( i dont know the boxes position)

Image

Then i want a way to put this boxes in layout (no auto generated), but this boxes have the same behavior, in other words, first 3 boxes to operation, next 2 boxes for solutions.

When i try to put boxes of this way,

Something like that

Image

But in the moment to question the correct answer, all boxes in the layout are converted in possible solutions, and i need only 2 next boxes, and after to pick the correct box, destroy the used boxes and continue with the next 5 boxes in the map.

i hope you can help me

here the cap

dropbox.com/s/axa8zfclv4vgf4f/Game.capx?dl=0


Thanks you
B
4
Posts: 50
Reputation: 290

Post » Thu Oct 01, 2015 9:31 am

First at all your game looks great and a very nice idea.

I think I can't really help, your game is quite to big and I have not enough time to understand it completely.
But I saw in your "SetearCajaResultado"-Function something that bothers me. I don't know if this could be your problem, but the first event in this function, you have an 'and'-block with 'pick all' and 'pick Caja where Caja.AsignarNumero=0'. If your player has a collision all blocks would be picked and all blocks would spawn a number. Anyway, the first condition with pick all should be necessary at all. But this is a wild guess I don't looked your game completely through.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Thu Oct 01, 2015 6:54 pm

Exactly asmodean, i see that!, the function "pick all" convert all boxes in the layout into possible questions, but as always exist only 5, convert the last boxes in questions, but if i change this condition, and i put more boxes through the map, with this function, all boxes will to convert in questions, and i dont know how to asign to question at only last 2 boxes in the operation, without pick all boxes.
In the code i cant find the exact line xD.

Maybe is a little problem, but i cannot see that
B
4
Posts: 50
Reputation: 290

Post » Thu Oct 01, 2015 8:39 pm

I think I understood your problem now. You want that if you overlap with the first result box, that the next result box reveal the result too. In the moment it works only if you spawn the boxes in real time during the game, but if you put the (result)boxes all in the layout in places, all boxes at once will show (spawn) the result. It's that correct?

I've made a capx and I hope that is what you want. It uses the pick nearest condition, so you have to be caution not to set the blocks of result boxes to tight or it could be that the wrong box is picked.
https://drive.google.com/file/d/0B5FlDY ... sp=sharing
B
24
S
3
G
1
Posts: 451
Reputation: 2,165


Return to How do I....?

Who is online

Users browsing this forum: beohs, Elliott, Yahoo [Bot] and 21 guests