Beginner’s guide to Rapid Prototyping Srinivasan V firstname.lastname@example.org
Agenda • Go through the process on how I do my prototyping • execu@ng the prototype rapidly • Show some samples on prototyping
How to get started on prototyping • Clear goal • Choose a tool which you are comfortable with • Not so clear technical breakdown • Must have modules – Input mechanism – touch, accelerometer – Feedback • Sound • Visual – Game loop must be complete
What is cocos2dx? – PlaOorm independent – Easy to use 2d game making tool – Excellent community support – C++ based, helps in cross-‐plaOorm – Supports many plaOorms including iOS, Android, Windows PC, etc. – PlaOorm dependent debugging • Instruments for iOS • GDB for Android • Visual Studio debugging for Windows – MIT license, so can publish for free, no royal@es.
cocos2d VS cocos2dx • Cocos2d is plaOorm dependent. Each plaOorm has its unique port – iOS uses Objec@ve C for cocos2d engine code – Android port uses C++ • Cocos2dx uses C++ for its engine code – You will write game code in C++ • Which one is beYer? – Does not maYer for your ﬁrst game unless you want to go cross-‐plaOorm – Focus on quality for your ﬁrst game, choice is irrelevant. – So just pick one and get going!
My Rapid prototyping process • Once goal is deﬁned, start coding instantly. • Use art assets from web (do not steal, just use them temporarily to showcase your idea) • Iterate all the @me • Do not worry about code structure • Have a playable build end of every day • Log everything as much as possible
• Make tweak tweakable • Parameterize everything • Divide all code into smaller func@ons • Load unload all the @me, modern plaOorms support these very well • Thread everything, use blocks on iOS, it runs fast
How do you do this with cocos2dx? • HelloWorldScene has everything you need. • Add in input system depending upon plaOorm • Make sure CocosDenshion is added for sounds • Start with rendering your ﬁrst 2d sprite using CCSprite • Try to do anima@on at a later stage unless the prototype demands it. – Use CCSpriteFrameCache
Proﬁle everyday • Run the build on target device everyday • Make sure it is designed for por@ng, so put all co-‐ordinates in percentages – (x = 512) -‐ Avoid – (x = getScreenWidth()/2) -‐ Correct • Focus on gameplay itera@ons and not on graphics polishing
Day schedule • Day 1 – setup workspace, add in all the input mechanism, setup target device debugging. Start adding in sprites • Day 2 – started pueng in some game logic • Day 3 – started reﬁning game logic, work on gameloop • Day 4 to Day 6 – reﬁned, proﬁle, reﬁned, proﬁle • Day 7 – started adding sounds, feedback fx, scoring
Module break-‐up • CCSprites for all assets – bg, cat, dog, bones, fruits. • CCPar@cleEmiYer for visual feedback on collision • CCMo@onStreak for trail • CCLabelTTF for font – scale to any size! • Game logic – hardly any J • Fps – 24 fps constant on 3rd gen ipod
Isometric games prototyping • CCTMXTiledMap & CCLayerPanZoom – Isometric @led map system – Camera control while panning – Collision detec@on using box2d, but not reac@on – Setup mul@-‐touch for naviga@on – Use tool to make levels