AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Cocos Visual Studio Tutorial4/23/2021
We will create a project based on the SimpleGame sample, build it on Windows and Android, and then do a simple modification to the game mechanics and use Visual Studio to debug it.Select VisualGDB-Android Project Wizard and specify a name for your project.If you are using Visual Studio 2010 or later, you can also enable the Create a Windows port option.
Note that the first build will take considerable time as the entire cocos2d-x framework will be rebuilt. The initial build may fail and VisualGDB will report that it has fixed the configuration files and a rebuild is required. VisualGDB will automatically deploy the app on your device and start debugging it: Warning: Dont use the Android emulator, as it does not support OpenGL reliably. Cocos Visual Studio Tutorial Code Responsible ForThe code responsible for defining the projectile trajectory is located in HelloWorld::ccTouchesEnded(). We will replace it with the code that will limit the projectile trajectory within the screen borders and invert the vertical component of the speed each time a border is hit. If you look at the call stack, you will notice that most of the cocos2d-x frames are the same as on Windows and the only difference is the Java frame below. Tap the device screen in different locations to see how bouncing works. Of course if you have a complete version installed it will work fine as well. Cocos2d-x is a cross platform, C based port of the popular Cocos2D ObjectiveC game development library. Using the most recent version of Cocos2D-x you can target Windows, Mac, Linux, iOS and Android. Previous versions enabled you to target even more targets including Blackberry and Tizen. The history of Cocos2D-x is actually very important, as it factored in many of the design decisions that the library has taken. This particular part covers the process of getting Cocos2d-x installed, creating an initial project and looks at a bare bones Hello World example. I promise you, this will be the only history lesson in this entire series Unless of course I do more of them If you want a more thorough history, you can always check out the wiki. As you may be able to guess from the fact it was started by a bunch of Python developers, Cocos started off being written in Python. A number of Cocos2d-iphone developed apps started appearing on the iPhone, including StickWars, which hit number 1 on the App Store. Now we hit the fast forward button on history and see that Cocos2d is ported to a number of platforms. Cocos2d-x itself also spawned a number of ports, including HTML and XNA. Along the way a number of tools were developed as well, including an editor named CocosStudio (itself the spawn of a number of child projects ) and CocosCodeIDE and IDE for Lua and JavaScript scripting in Cocos2d-x. Each language and platform has had an effect on the development of Cocos2d-x, for better or worse. More often than not, its Cocos2Ds history that provides the reason. This is by no means a negative, but we aware sometimes language can be a bit of a barrier when looking for help and reading documentation. This is because I am trying to future proof this series as much as possible. In all honesty, I know this is going to be quite annoying as well, when I created by cocos2d-html5 tutorial series, the number one problem was version changes. Cocos2d-x is a library that gets refactored quite a bit, so if you are far in the future and some code I provided doesnt work, this is probably why. Always make sure to read the comments at the bottom of each part, it may contains clues to the problem you are facing. You have a choice between Cocos2d 2.x, 3.0 or 3.x right now. The 2.x version is obviously the older version and less actively developed, if at all ( edit according to this thread, 2.x is no longer being supported). That said, 2.x also supports the most platforms, including Windows Phone, Marmalade, Tizen, Blackberry and more. Additionally, as of writing, every single book targets 2.x. If you are working on Windows, Visual Studio 2013 is currently the recommended version. Cocos Visual Studio Tutorial Download A FreeYou can download a free version named Visual Studio Express for Windows Desktop ( note, there is also a version called Visual Studio Express for Windows, you do NOT want this version yeah, brilliant naming by Microsoft there eh ).
0 Comments
Read More
Leave a Reply. |