s1ddok / fiber2d Goto Github PK
View Code? Open in Web Editor NEWCross-platform 2D Game Engine in pure Swift
Cross-platform 2D Game Engine in pure Swift
This lib can or will be possible to call methods from native view?
More info about this question: http://stackoverflow.com/questions/41638598/interact-with-cocos2d-x-scene-at-android-ios-native-window
Thanks,
I followed the install instructions but on Step 3 I got the following:
error: the module at /Users/nixarn/Projects/Fiber2D/misc does not contain any source files
fix: either remove the module folder, or add a source file to the module
Same problem when I opened the OSX project and trying to run it
As I understand you killed objc-cocos2d, fiber2d is too raw to use in serious projects (it even becomes a hell to run demo project).
Could you suggest an alternative with objc/swift programming?
https://developer.apple.com/ios/whats-new/
Apps built using OpenGL ES will continue to run in iOS 12, but Open GL ES is deprecated in iOS 12. Games and graphics-intensive apps that previously used OpenGL ES should now adopt Metal.
I just want to talk about Swift and it's future.
First rumors was like Google want to make it first class lang: https://thenextweb.com/dd/2016/04/07/google-facebook-uber-swift/
Currently for cross-platform game development I'm using cocos2d-x and C++, which is supported by platform IDE's: Xcode and android studio. This gives me a top level of controll and I can easy use any new features in these IDE's. Overall like I can say - ability to work natively. This is really cool. But what is not cool, it's C++. It's fast, powerful but it's not easy to learn it and overall it's too complicated..
So, I waited for Swift to be official on android maybe.. But what do we have now: Kotlin is now an official android language.
https://developer.android.com/kotlin/index.html
https://android-developers.googleblog.com/2017/05/android-announces-support-for-kotlin.html
Swift is like Kotlin. Or better to say vice versa? Kotlin first appeared at 2011, but Swift at 2014. Well, whatever..
And fun to compare some syntax of both languages:
http://nilhcem.com/swift-is-like-kotlin/
Anyway, this means no way for Swift for android. I don't believe that Google has any plans for it.
Finally, looks like C++ is only the one right way.. and we have cocos2d-x, but they currently moving into wrong direction - to JS. Also, they developing closed-source editor, same crappy as was android studio. For me it's like "china low quality product".
Any ideas, thought about all this?
p.s. pls don't close this issue to early. cocos2d forum died, so no place to talk about this I think.
cd external/SwiftBGFX
sh prepare_bgfx_macos.sh
Building configurations...
Running action 'ninja'...
Generating ../.build/projects/ninja-osx/Makefile...
Generating ../.build/projects/ninja-osx/debug32/build.ninja...
Generating ../.build/projects/ninja-osx/release32/build.ninja...
Generating ../.build/projects/ninja-osx/debug64/build.ninja...
Generating ../.build/projects/ninja-osx/release64/build.ninja...
Generating ../.build/projects/ninja-osx/debug/build.ninja...
Generating ../.build/projects/ninja-osx/release/build.ninja...
Generating ../.build/projects/ninja-osx/debug32/bgfx.ninja...
Generating ../.build/projects/ninja-osx/release32/bgfx.ninja...
Generating ../.build/projects/ninja-osx/debug64/bgfx.ninja...
Generating ../.build/projects/ninja-osx/release64/bgfx.ninja...
Generating ../.build/projects/ninja-osx/debug/bgfx.ninja...
Generating ../.build/projects/ninja-osx/release/bgfx.ninja...
Generating ../.build/projects/ninja-osx/debug32/bx.ninja...
Generating ../.build/projects/ninja-osx/release32/bx.ninja...
Generating ../.build/projects/ninja-osx/debug64/bx.ninja...
Generating ../.build/projects/ninja-osx/release64/bx.ninja...
Generating ../.build/projects/ninja-osx/debug/bx.ninja...
Generating ../.build/projects/ninja-osx/release/bx.ninja...
Generating ../.build/projects/ninja-osx/debug32/bimg.ninja...
Generating ../.build/projects/ninja-osx/release32/bimg.ninja...
Generating ../.build/projects/ninja-osx/debug64/bimg.ninja...
Generating ../.build/projects/ninja-osx/release64/bimg.ninja...
Generating ../.build/projects/ninja-osx/debug/bimg.ninja...
Generating ../.build/projects/ninja-osx/release/bimg.ninja...
Generating ../.build/projects/ninja-osx/debug32/bimg_decode.ninja...
Generating ../.build/projects/ninja-osx/release32/bimg_decode.ninja...
Generating ../.build/projects/ninja-osx/debug64/bimg_decode.ninja...
Generating ../.build/projects/ninja-osx/release64/bimg_decode.ninja...
Generating ../.build/projects/ninja-osx/debug/bimg_decode.ninja...
Generating ../.build/projects/ninja-osx/release/bimg_decode.ninja...
Done. Generated 31/31 projects.
make: ninja: No such file or directory
make: *** [clean] Error 1
make: ninja: No such file or directory
make: *** [clean] Error 1
==== Building bgfx (debug64) ====
make: ninja: No such file or directory
make: *** [bgfx] Error 1
==== Building bgfx (release64) ====
make: ninja: No such file or directory
make: *** [bgfx] Error 1
make macos
swift build -Xswiftc -Iexternal/SwiftBGFX/3rdparty/bgfx/3rdparty/khronos -Xswiftc -Iexternal/SwiftBGFX/3rdparty/bx/include -Xswiftc -Iexternal/SwiftBGFX/3rdparty/bgfx/3rdparty -Xlinker -lc++ -Xlinker -lbgfxDebug -Xlinker -lbxDebug -Xlinker -lbimgDebug -Xlinker -lz -Xcc -DCP_USE_CGTYPES=0 -Xlinker -framework -Xlinker AppKit -Xlinker -framework -Xlinker Quartz -Xlinker -Lexternal/SwiftBGFX/3rdparty/bgfx/.build/osx64_clang/bin -Xcc -Iexternal/SwiftBGFX/3rdparty/bx/include/compat/osx -Xcc -DBGFX_CONFIG_RENDERER_METAL=1 -Xlinker -framework -Xlinker Metal -Xlinker -framework -Xlinker MetalKit -Xlinker -framework -Xlinker Foundation
Compile Swift Module 'Fiber2D' (106 sources)
/Users/jpope/Desktop/Fiber2D/Fiber2D/Node+Scene.swift:32:22: error: missing argument for parameter #1 in call
onEnter.fire()
^
<#Void#>
/Users/jpope/Desktop/Fiber2D/Fiber2D/events/Event.swift:79:17: note: 'fire' declared here
public func fire(_ data: T) {
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/Node+Scene.swift:37:41: error: missing argument for parameter #1 in call
onEnterTransitionDidFinish.fire()
^
<#Void#>
/Users/jpope/Desktop/Fiber2D/Fiber2D/events/Event.swift:79:17: note: 'fire' declared here
public func fire(_ data: T) {
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/Node+Scene.swift:42:39: error: missing argument for parameter #1 in call
onExitTransitionDidStart.fire()
^
<#Void#>
/Users/jpope/Desktop/Fiber2D/Fiber2D/events/Event.swift:79:17: note: 'fire' declared here
public func fire(_ data: T) {
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/Node+Scene.swift:56:21: error: missing argument for parameter #1 in call
onExit.fire()
^
<#Void#>
/Users/jpope/Desktop/Fiber2D/Fiber2D/events/Event.swift:79:17: note: 'fire' declared here
public func fire(_ data: T) {
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionEase.swift:32:16: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
action.update(state: easeBlock(state))
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionEase.swift:32:30: note: conflicting access is here
action.update(state: easeBlock(state))
^~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:87:32: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
innerContainer.update(state: dt - (nextDt - 1.0 / Float(repeatCount)))
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:87:52: note: conflicting access is here
innerContainer.update(state: dt - (nextDt - 1.0 / Float(repeatCount)))
^~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:87:32: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
innerContainer.update(state: dt - (nextDt - 1.0 / Float(repeatCount)))
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:87:73: note: conflicting access is here
innerContainer.update(state: dt - (nextDt - 1.0 / Float(repeatCount)))
^~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:71:32: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
innerContainer.start(with: target)
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:71:44: note: conflicting access is here
innerContainer.start(with: target)
^~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:109:28: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
innerContainer.start(with: target)
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:109:40: note: conflicting access is here
innerContainer.start(with: target)
^~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:40:28: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
innerContainer.start(with: target)
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionRepeat.swift:40:40: note: conflicting access is here
innerContainer.start(with: target)
^~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionSequence.swift:37:28: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
actions[0].start(with: target)
~~~~^~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionSequence.swift:37:40: note: conflicting access is here
actions[0].start(with: target)
^~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionSequence.swift:61:28: error: simultaneous accesses to parameter 'self', but modification requires exclusive access; consider copying to a local variable
actions[found].start(with: target)
~~~~~~~~^~~~~~~~~~~~~~~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/ActionSequence.swift:61:40: note: conflicting access is here
actions[found].start(with: target)
^~~~~~
/Users/jpope/Desktop/Fiber2D/Fiber2D/System.swift:47:12: warning: redundant conformance constraint 'T': 'Component'
where T: Component {
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/System.swift:46:48: note: conformance constraint 'T': 'Component' inferred from type here
public func subtree(of type: T.Type) -> ComponentNode
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/System.swift:47:12: warning: redundant conformance constraint 'T': 'Component'
where T: Component {
^
/Users/jpope/Desktop/Fiber2D/Fiber2D/System.swift:46:48: note: conformance constraint 'T': 'Component' inferred from type here
public func subtree(of type: T.Type) -> ComponentNode
^
error: terminated(1): /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/jpope/Desktop/Fiber2D/.build/debug.yaml
make: *** [macos] Error 1
Welcome to Apple Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8). Type :help for assistance.
-[MTLDebugRenderCommandEncoder setScissorRect:]:2029: failed assertion `(rect.y(0) + rect.height(1024))(1024) must be <= 768'
Hi, I'm pretty interested in this project and was wondering what the status is on development/whether the project is at a point where you want contributions and have an idea where help is most useful
It's great to see this effort out there. I really am not sure where to turn to get a cross-platform engine written in swift that has an API like cocos2d
Swift 4.0.3
XCode 9.2
I was able to get the MacOS project running via the instructions without issue. However, while following the iOS instructions I first came across build errors with the message
Missing required module 'Cbgfx'
So after some Googling I found this answer: https://stackoverflow.com/questions/31757417/swift-app-missing-required-module-when-importing-framework-that-imports-stati
Which led me to find the Cbgfx module map and point to it in the demo search paths.
$(SRCROOT)/Fiber2D-iOS.xcodeproj/GeneratedModuleMap/Cbgfx
This worked to stop the Cbgfx complaints but then I got two new problems:
Missing required modules: 'CChipmunk2D', 'Cpng'
So now I'm wondering if I've just set things up incorrectly or if something has changed since the instructions were made. From what it looks like to me the framework themselves build no problem:
Any advice on where I might be going wrong? Thanks
Abandoned?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.