fantomX - A game framework for Cerberus X (mojo2)

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Hello

this is my game framework called fantomX. It is using mojo2, so you can only use it with Cerberus X targets that mojo2 supports.

To download it, go to its GitHub release page here: https://github.com/MikeHart66/fantomX/releases

It ships will numberous examples and a good sized documentation which you can also find here: http://fxdocs.fantomgl.com/

fantomX currently supports the following features:
  • Various objects like images, tile maps, graphic primitives, sounds, collision zones, scenes and layers.
  • Automatic processes to create, update and render objects.
  • Callback methods which are called during the handling of an object, layer, timer and transitions.
  • Layer transitions with callback methods.
  • Extensive handling methods for the engine's objects.
  • Object transitions for position, rotation, scaling and alpha values with callback methods.
  • Several equation and ease types for object and layer transitions.
  • Object timers with callback methods.
  • Different collision methods for objects with callback methods.
  • Touch input handling with callback methods.
  • Organize your objects in layers.
  • Automatic content scaling via providing a virtual canvas setup.
  • Simple high-score list loading, saving and updating.
  • Simple sound loading which handles the proper file extension depending on the chosen platform.
  • Support for bitmap font text objects which load EzGUI font descriptions.
  • Build-in frames per second calculator.
  • Simple camera/view support which you can move around to render parts of your scenery.
  • Support for texture maps (atlas) created by the tool TexturePacker.
  • Support for tile maps created by the tool Tiled.
  • Embedded object informations inside a Tiled map will be imported and are accessable.
  • Engine time scaling supporting object updates, timers and transitions.
  • Automatic swipe gesture detection with event method.
  • Path/Waypoint handling. Let your objects follow them.
  • A* pathfinding und user definable grids of nodes. It doesn't have to be a grid of squares!
  • Integration of Box2D powered physics including ray casting. Physics definition created by the tool PhysicsEditor are supported too.
  • Localize your game easily with easy support of multiple languages.
  • Support different key maps for different controllers or user definitions.
  • Easy scene/room management.
  • Objects can be composed of several single images.
  • Automatic object pooling.
  • Custom GUI elements.
  • Support for 9-slice image scaling.
 

Ferret3D

Member
Joined
Aug 13, 2017
I get a compile error :(
Code:
TRANS cerberus compiler V2017-07-31
Parsing...
Modpath error - import=monkey.map, existing=monkey.list
Semanting...
D:/Cerberus/modules_ext/fantomX/cftAStar.monkey<27> : Error : Duplicate identifier 'list' found in module 'xml' and module 'cerberus'.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Mmh,weird. The pathfinding example works perfectly here. WHAT did you try to compile?

Scrap that, the Github version behaves differently then what I have here. I will look into this.
 
Last edited:

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Ok, in the fantomX/xml/xml.monkey file, change the import to monkey.list and monkey.map like this:

upload_2017-8-31_6-21-41.png
 

Ferret3D

Member
Joined
Aug 13, 2017
Original file wich gave me the compile error
Code:
Import monkey.list
Import monkey.Map
Also tried this with a bunch of errors
Code:
Import cerberus.list
Import cerberus.map
 

Ferret3D

Member
Joined
Aug 13, 2017
The second one gives me this
Code:
TRANS cerberus compiler V2017-07-31
Parsing...
Semanting...
Translating...
Building...
g++  -m64  -O0 -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Debug64/main.o ../main.cpp
../main.cpp:22123:30: error: expected initializer before '-' token
 extern c_cGame* bb_BallPuzzle-FantomX__g;
                              ^
../main.cpp:152681:23: error: expected initializer before '-' token
 c_cGame* bb_BallPuzzle-FantomX__g;
                       ^
../main.cpp: In function 'int bbMain()':
../main.cpp:152685:12: error: 'bb_BallPuzzle' was not declared in this scope
  gc_assign(bb_BallPuzzle-FantomX__g,(new c_cGame)->m_new());
            ^
../main.cpp:152685:26: error: 'FantomX__g' was not declared in this scope
  gc_assign(bb_BallPuzzle-FantomX__g,(new c_cGame)->m_new());
                          ^
../main.cpp: In function 'int bbInit()':
../main.cpp:209508:2: error: 'bb_BallPuzzle' was not declared in this scope
  bb_BallPuzzle-FantomX__g=0;
  ^
../main.cpp:209508:16: error: 'FantomX__g' was not declared in this scope
  bb_BallPuzzle-FantomX__g=0;
                ^
../main.cpp: In function 'void gc_mark()':
../main.cpp:209654:12: error: 'bb_BallPuzzle' was not declared in this scope
  gc_mark_q(bb_BallPuzzle-FantomX__g);
            ^
../main.cpp:209654:26: error: 'FantomX__g' was not declared in this scope
  gc_mark_q(bb_BallPuzzle-FantomX__g);
                          ^
mingw32-make: *** [build/Debug64/main.o] Error 1
Makefile:59: recipe for target 'build/Debug64/main.o' failed
TRANS FAILED: Error executing 'mingw32-make CCOPTS=" -m64  -O0" LDOPTS=" -m64  -L../openal/libs/Win64 -L../curl/lib/Win64" OUT="Debug64/CerberusGame"', return code=2
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
I think this has nothing to do with fantomX but how you named something there. there is a minus sign.

Can I see the cxs source?
 

Ferret3D

Member
Joined
Aug 13, 2017
Sorry, mi bad.
I was testing this in an existing project folder.
Not sure if that has anything to do with it but i created a new one and got it to compile for android and win32.

Compiling for win64 gave me an error.
Code:
TRANS cerberus compiler V2017-07-31
Parsing...
Semanting...
Translating...
Building...
g++  -m64  -O0 -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Debug64/main.o ../main.cpp
D:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/as.exe: build/Debug64/main.o: too many sections (36461)
D:\CerberusProjects\FantomXTest\FantomXTest.buildv2017-07-31\glfw3\gcc_winnt\build\Debug64\ccAnQSze.s: Assembler messages:
D:\CerberusProjects\FantomXTest\FantomXTest.buildv2017-07-31\glfw3\gcc_winnt\build\Debug64\ccAnQSze.s: Fatal error: can't write build/Debug64/main.o: File too big
D:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/as.exe: build/Debug64/main.o: too many sections (36461)
D:\CerberusProjects\FantomXTest\FantomXTest.buildv2017-07-31\glfw3\gcc_winnt\build\Debug64\ccAnQSze.s: Fatal error: can't close build/Debug64/main.o: File too big
mingw32-make: *** [build/Debug64/main.o] Error 1
Makefile:59: recipe for target 'build/Debug64/main.o' failed
TRANS FAILED: Error executing 'mingw32-make CCOPTS=" -m64  -O0" LDOPTS=" -m64  -L../openal/libs/Win64 -L../curl/lib/Win64" OUT="Debug64/CerberusGame"', return code=2
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Well, mingw32 compiling for 64???? I don't think this is possible. I have only the 64 bit version of mingw installed. Works fine here.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Here is the output I get:

Code:
"C:/Users/Micha/Desktop/FantomMonkey/Cerberus/bin/transcc_winnt" -target=Desktop_Game_(Glfw3) -config=Release -run "C:/Users/Micha/Desktop/FantomMonkey/Cerberus/modules_ext2/fantomX/examples/BaseScript/BaseScript.monkey"

TRANS cerberus compiler V2017-07-31

Parsing...

Semanting...

Translating...

Building...

gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/context.o ../glfw3/src/context.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/egl_context.o ../glfw3/src/egl_context.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/init.o ../glfw3/src/init.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/input.o ../glfw3/src/input.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/monitor.o ../glfw3/src/monitor.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/osmesa_context.o ../glfw3/src/osmesa_context.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/vulkan.o ../glfw3/src/vulkan.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/wgl_context.o ../glfw3/src/wgl_context.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/win32_init.o ../glfw3/src/win32_init.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/win32_joystick.o ../glfw3/src/win32_joystick.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/win32_monitor.o ../glfw3/src/win32_monitor.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/win32_time.o ../glfw3/src/win32_time.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/win32_thread.o ../glfw3/src/win32_thread.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/win32_window.o ../glfw3/src/win32_window.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/window.o ../glfw3/src/window.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/stb_vorbis.o ../stb/stb_vorbis.c
gcc -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/stb_image.o ../stb/stb_image.c
g++ -m64 -O3 -DNDEBUG -Wno-free-nonheap-object -I../curl/include -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release64/main.o ../main.cpp
g++ -m64 -L../openal/libs/Win64 -L../curl/lib/Win64 -Wl,--subsystem,windows -o Release64/CerberusGame build/Release64/context.o build/Release64/egl_context.o build/Release64/init.o build/Release64/input.o build/Release64/monitor.o build/Release64/osmesa_context.o build/Release64/vulkan.o build/Release64/wgl_context.o build/Release64/win32_init.o build/Release64/win32_joystick.o build/Release64/win32_monitor.o build/Release64/win32_time.o build/Release64/win32_thread.o build/Release64/win32_window.o build/Release64/window.o build/Release64/stb_vorbis.o build/Release64/stb_image.o build/Release64/main.o -lcomdlg32 -lgdi32 -lopengl32 -lOpenAL32 -lcurldll -lws2_32

Done.
 

Dubbsta

Active Member
Joined
Jul 13, 2017
i get an error when compiling in cerberusx " xml and cerberusx module have identical list" ??
 
Top Bottom