Rayj Posted July 25, 2015 Share Posted July 25, 2015 So, I am fairly new at Javascript programmng and totally new to Pixi.js. How do I initilize an array with gif file names or pointers, so later I can call up the graphicto display? What I want to do is create a deck of playing cards and later deal them out.I have the rendomization figured out already. I have the graphic gif files representing each card of the 52 card deck named: h1.gif-h13.gif, c1.gif-c13.gif, d1.gif-d13.gif and s1.gif-s13.gif representing the suits Hearts, Clubs, Diamonds and spades respectively. So card[0] would be Ace of Hearts. card[1] = 2 of hearts,.... card[13] = king of hearts, card[14] = Ace of Diamonds, card[15] = 2 of Diamonds,etc. See attached example. So the main thing I need is to populate the array size of 52 with the corresponding gif file names.Thanks,Ray Quote Link to comment Share on other sites More sharing options...
Rayj Posted July 25, 2015 Author Share Posted July 25, 2015 My attachment would not load. Sorry. Quote Link to comment Share on other sites More sharing options...
pdiddles03 Posted July 26, 2015 Share Posted July 26, 2015 I may be misunderstanding your question, bit you could use your array.push('card.gif') Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.