arrSprite

For questions about using Classic.

Post » Mon Apr 08, 2013 4:46 pm

How to declare an array of sprite using construct classic ?

for example using java

String[] arrSprite = {man, woman, monster, kid}; Just look like this.

Because I want to spawn sprites randomly. I know there is another way but I want to do it in this way. Is it possible ?
B
5
S
1
Posts: 20
Reputation: 690

Post » Mon Apr 08, 2013 6:14 pm

Do you mean you want to spawn a random object out of a set of objects?
If so you could use the "create object by name" action and use
[code]{"man", "woman", "monster", "kid"}@(random(4)+1)[/code] as the object type.
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Tue Apr 09, 2013 11:09 am



COOL! Thank you!
B
5
S
1
Posts: 20
Reputation: 690

Post » Tue Apr 09, 2013 5:51 pm

Oh man, this is helping alot.

I was wondering if there is any compendium of the Construct syntax as I stumbe across new expressions on a somewhat regular basis?

Cheers
The Colonel
Image
B
13
S
4
G
1
Posts: 113
Reputation: 1,712

Post » Wed Apr 10, 2013 6:09 pm

[quote]I was wondering if there is any compendium of the Construct syntax...[/quote]
http://sourceforge.net/apps/mediawiki/construct/index.php?title=Expressions
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests