6

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

Anand
  • 1,129
  • 7
  • 29
  • Are you adding C++ to a Swift project? – Caleb Kleveter Sep 02 '15 at 14:58
  • I am done with this integration using , bridging of Swift and Objective C and made a simple class when I can push CCDirector to the current navigation controller and one method from Cocos2dx class calls Objective C class and objective C class calls back the Swift method to Pop the view controller – Anand Sep 17 '15 at 09:55
  • I will Soon, post the details regarding what I did to make these bridging classes and how it all worked for me. – Anand Sep 17 '15 at 09:56
  • @Anand how you did that? – Marckaraujo Jan 13 '17 at 16:32

1 Answers1

2

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

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

Grigori Jlavyan
  • 1,871
  • 3
  • 19
  • 39