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

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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.

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks a lot Ram. Your .capx tutorial helped me out, and I fixed my problem.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)