ysrikanth2011 Posted March 28, 2013 Share Posted March 28, 2013 Hello, I am trying to draw a design for coins that the player collects like in super mario game. The coins design might have some fixed number like 8 designs. I want to draw these based on some random number generation and picking up one design . I am using a paralaxer background and moving the coins. After the coins have gone behind the screen I want to draw a new design. I don't know how to do this as I am new to game programming, my friend suggested me a possible way might be to include an xml file ,which contains like 0 ,1's you draw where there are 1's and leave where there are 0's . I am using cocos2d-html5 for programming. I don't think it is a better idea to use text files to achieve this ,Is it ? If you have any better idea ,please tell me. Any code samples or weblinks(only in javascript) are greatly appreciated. I am posting a sample design ,how I want it to be., like this I am going to have several designs. Quote Link to comment Share on other sites More sharing options...
tyson Posted March 28, 2013 Share Posted March 28, 2013 If you're using TMX maps it might be easy to just make an Object layer where the coin group would appear.Then in your code look for all the 'coin group' objects and make new instances of the coin group, with a random design parsed into the constructor. Here's a good tutorial for Cocos2d-x, which is mostly applicable to Cocos2d-html5. http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d 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.