(SOLVED) How do I make arrays create an object?

Get help using Construct 2

Post » Wed Sep 30, 2015 4:03 am

In my game, whenever a specific value is chosen in an array, I want a different sprite to appear. How would I do that? Link to my code: s30.postimg(dot)org/wtoe2a3k1/Capture.png

Be sure to change (dot) into a . above.
Last edited by TechnoBeaver on Wed Sep 30, 2015 7:19 pm, edited 1 time in total.
B
12
S
3
Posts: 68
Reputation: 906

Post » Wed Sep 30, 2015 8:05 am

I've had a quick look at your screen capture and just going off that, obviously not knowing the rest of your program, I would go about it like this:

https://goo.gl/Cl00oa

This does not do what you asked - I go about it a different way. If you need to choose images from your array you are almost there. Where you are saying if music name is the equivalent of "bounce" add an action after this saying create sprite "picture required".

Anyway have a quick look at my version and see if you can take anything from it.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Wed Sep 30, 2015 10:46 am

Sorry, probably should have described what my problem was. Basically, when the game starts, a song is randomly chosen to play by an array. Based on which song plays (the value) I want a certain Sprite to appear. Whenever I run it though, the same Sprite appears no matter what the value is.

I'll try out your fix later and tell you if it works for me. Thanks for the reply though.
B
12
S
3
Posts: 68
Reputation: 906

Post » Wed Sep 30, 2015 7:18 pm

Thanks a lot Ram. Your .capx tutorial helped me out, and I fixed my problem.
B
12
S
3
Posts: 68
Reputation: 906


Return to How do I....?

Who is online

Users browsing this forum: batto and 21 guests