Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Cocos2dx project within Swift Project (XCode 6.3)

I have 2 separate Projects one is in Cocos2dx v3.6 and one is in Swift. I want to start a game from the Swift project. How can I do it?

I have copied whole cocos2dx project into my Swift project and then created one View Controller in swift and trying to open CCDirector as a root view of the project. but not able to find director, I am trying to import cocos2dx with this #import "cocos2d.h" , but it is giving me error of "undefined file".

This is how I added Cocos2dx project in my Swift Project

Apple Swift version 1.2

like image 406
Anand Avatar asked Aug 27 '15 07:08

Anand


People also ask

What is cocos2d-swift?

Cocos2D-Swift is a framework for building 2D games, demos, and other graphical/interactive applications for iOS, Mac and Android. It is based on the Cocos2D design, but instead of using Python it uses Swift or Objective-C. New Cocos2D projects are created with SpriteBuilder. SpriteBuilder is, just like Cocos2D, free and open source.

What's new in Xcode 6?

Xcode 6 includes Swift, an innovative programming language with an interactive work area called a playground. Developers can directly manipulate and experiment with Swift code live—enter the code for a Bézier path in the playground and watch the path drawn directly beside the code.

Which version of Xcode is compatible with iOS?

Xcode 6.1 Xcode 6.1 adds development for OS X with Swift, and includes bug fixes as well as other new features. SDK Support for OS X Yosemite Xcode 6.1 includes development support with SDKs for OS X version 10.9, OS X version 10.10, and iOS 8.


1 Answers

You can use version Cocos2d for Swift it is here. this

Also I suggest you use this tutorial it is very simple todo.

like image 51
Grigori Jlavyan Avatar answered Oct 04 '22 11:10

Grigori Jlavyan