Random text position without collisions

Get help using Construct 2

Post » Sun Jan 13, 2013 11:56 pm

Hi all, I search in the forum for a solution but nothing.
I have to position some text (in my case numbers) randomly on the screen. This work fine. The problem is that sometimes my numbers overlap each other... like in the picture...
Is there a check collision like for the sprites? I don't find anything for the text.

Thank'you!

B
16
S
4
Posts: 35
Reputation: 2,292

Post » Mon Jan 14, 2013 11:42 pm

Just create invisible sprites that match the size of the text and check those for collisions. There was something to that effect done a few days ago, but cannot remember the thread... if I do I'll point you to it.
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Tue Jan 15, 2013 10:16 am

Yes, thanx procrastinator, I understand what you mean and I already create a sprite that is created where the random text goes.
B
16
S
4
Posts: 35
Reputation: 2,292

Post » Tue Jan 15, 2013 10:51 am

I posted an example capx for a request in another thread almost exactly like this recently. Since you've already got the sprites set up, it's just a matter of testing collisions, destroying and recreating overlapping instances.

http://www.scirra.com/forum/on-start-of-layout-loops-logic-collsions_topic61745_post379018.htmlGeometriX2013-01-15 11:00:31
B
56
S
15
G
10
Posts: 910
Reputation: 11,952

Post » Tue Jan 15, 2013 8:37 pm

I found a similar solution, but you give me a trick in the "repeat 10 times" sub-event! :-)
Thanx "horrorific zombie" ilraffo2013-01-15 20:38:53
B
16
S
4
Posts: 35
Reputation: 2,292

Post » Wed Jan 16, 2013 8:09 am

My pleasure, Spider-Pig. See, we're not all bad people :PGeometriX2013-01-16 08:10:01
B
56
S
15
G
10
Posts: 910
Reputation: 11,952


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests