Erel B4X founder Staff member Licensed User Longtime User Jun 2, 2021 #1 X2 is an open source, cross platform 2d game engine based on box2d physics engine and BitmapCreator as the rendering engine. X2 itself is a b4xlib library. The first versions of X2 lead the way to cross platform B4X projects. The new update goes the other way, and makes X2 work with B4XPages. This simplifies several things. There is also a new class named X2Multitouch which provides a cross platform method to handle touches, multitouches and keys (B4J). X2 works best with Tiled map editor: https://www.mapeditor.org/ Due to a compatibility with Tiled 1.9.0, please use this version for now: https://update.mapeditor.org/snapshots-win/Tiled-2021.03.23-win64.msi When you first start with Tiled, you need to import the x2 custom properties. This is done with: View - Objects Types Editor - File - Import and find objecttypes.json: X2\X2 Source Folder\Shared Files\objecttypes.json If you are not seeing the custom properties when selecting an object then it is misconfigured: X2 source code and examples are available on github: GitHub - AnywhereSoftware/X2: B4X X2 Games Framework B4X X2 Games Framework. Contribute to AnywhereSoftware/X2 development by creating an account on GitHub. github.com Download link: https://github.com/AnywhereSoftware/X2/archive/refs/heads/main.zip X2.b4xlib: https://github.com/AnywhereSoftware/X2/raw/main/X2 Source Folder/X2.b4xlib The first effort was to update the almost 20 examples to the new version. Some of the examples are a bit complex and are more of a "proof of concept" projects. Recommendations: 1. Start with B4J 2. Start with these examples and more or less in this order (the examples threads were not yet updated): - HelloWorld - GameTemplate - same as File - New - X2 Game. - Joints - https://www.b4x.com/android/forum/threads/96547/#content - Newton Cradle - https://www.b4x.com/android/forum/threads/97029/#content - Touchy - https://www.b4x.com/android/forum/threads/xui2d-touchy-example-x2multitouch.131307/ - Ilan's First App - https://www.b4x.com/android/forum/threads/very-very-very-simple-xui2d-test-project.96793/post-611080 - Tank Attack - https://www.b4x.com/android/forum/threads/xui2d-tank-example.96567/#content - Collisions - https://www.b4x.com/android/forum/threads/97144/#content - LargeBackground - https://www.b4x.com/android/forum/threads/xui2d-large-background-class-example.131589/ - ParallaxBackground - https://www.b4x.com/android/forum/threads/xui2d-parallax-background.131606/#post-829749 - Breakout - https://www.b4x.com/android/forum/threads/xui2d-breakout-example.131395/ - Space Shooter - https://www.b4x.com/android/forum/threads/99614/#content - Monster Truck - https://www.b4x.com/android/forum/threads/96622/#content - Tetris - no physics game - https://www.b4x.com/android/forum/threads/107698/#content - TilesMap - https://www.b4x.com/android/forum/threads/95508/#content - Mouse Following Path - https://www.b4x.com/android/forum/threads/98895/#content - Clumsy Bird: https://www.b4x.com/android/forum/threads/95302/#content - Space Shooter - https://www.b4x.com/android/forum/threads/99614/#content - Angry Birds: https://www.b4x.com/android/forum/threads/99052/#content - Mario - https://www.b4x.com/android/forum/threads/96236/#content - Space Invaders - https://www.b4x.com/android/forum/threads/96263/#content - MultiplePages - A simple example where the template game is hosted in a different B4XPage. Proof of concept projects: - Walking Character - includes all kind of random features. - Lines - https://www.b4x.com/android/forum/threads/96934/#content - Floating bodies: https://www.b4x.com/android/forum/threads/98243/#content Tips - The files from the Shared Files folder are copied to the platform specific folder during compilation. Don't update the files in the Files folder as they will be overwritten (except of files unique to the current platform). Updated X2 Game.b4xtemplate is attached. It includes the manifest line from post #10. Attachments X2 Game.b4xtemplate X2 Game.b4xtemplate 91.2 KB · Views: 1,503 Last edited: Jul 22, 2022
X2 is an open source, cross platform 2d game engine based on box2d physics engine and BitmapCreator as the rendering engine. X2 itself is a b4xlib library. The first versions of X2 lead the way to cross platform B4X projects. The new update goes the other way, and makes X2 work with B4XPages. This simplifies several things. There is also a new class named X2Multitouch which provides a cross platform method to handle touches, multitouches and keys (B4J). X2 works best with Tiled map editor: https://www.mapeditor.org/ Due to a compatibility with Tiled 1.9.0, please use this version for now: https://update.mapeditor.org/snapshots-win/Tiled-2021.03.23-win64.msi When you first start with Tiled, you need to import the x2 custom properties. This is done with: View - Objects Types Editor - File - Import and find objecttypes.json: X2\X2 Source Folder\Shared Files\objecttypes.json If you are not seeing the custom properties when selecting an object then it is misconfigured: X2 source code and examples are available on github: GitHub - AnywhereSoftware/X2: B4X X2 Games Framework B4X X2 Games Framework. Contribute to AnywhereSoftware/X2 development by creating an account on GitHub. github.com Download link: https://github.com/AnywhereSoftware/X2/archive/refs/heads/main.zip X2.b4xlib: https://github.com/AnywhereSoftware/X2/raw/main/X2 Source Folder/X2.b4xlib The first effort was to update the almost 20 examples to the new version. Some of the examples are a bit complex and are more of a "proof of concept" projects. Recommendations: 1. Start with B4J 2. Start with these examples and more or less in this order (the examples threads were not yet updated): - HelloWorld - GameTemplate - same as File - New - X2 Game. - Joints - https://www.b4x.com/android/forum/threads/96547/#content - Newton Cradle - https://www.b4x.com/android/forum/threads/97029/#content - Touchy - https://www.b4x.com/android/forum/threads/xui2d-touchy-example-x2multitouch.131307/ - Ilan's First App - https://www.b4x.com/android/forum/threads/very-very-very-simple-xui2d-test-project.96793/post-611080 - Tank Attack - https://www.b4x.com/android/forum/threads/xui2d-tank-example.96567/#content - Collisions - https://www.b4x.com/android/forum/threads/97144/#content - LargeBackground - https://www.b4x.com/android/forum/threads/xui2d-large-background-class-example.131589/ - ParallaxBackground - https://www.b4x.com/android/forum/threads/xui2d-parallax-background.131606/#post-829749 - Breakout - https://www.b4x.com/android/forum/threads/xui2d-breakout-example.131395/ - Space Shooter - https://www.b4x.com/android/forum/threads/99614/#content - Monster Truck - https://www.b4x.com/android/forum/threads/96622/#content - Tetris - no physics game - https://www.b4x.com/android/forum/threads/107698/#content - TilesMap - https://www.b4x.com/android/forum/threads/95508/#content - Mouse Following Path - https://www.b4x.com/android/forum/threads/98895/#content - Clumsy Bird: https://www.b4x.com/android/forum/threads/95302/#content - Space Shooter - https://www.b4x.com/android/forum/threads/99614/#content - Angry Birds: https://www.b4x.com/android/forum/threads/99052/#content - Mario - https://www.b4x.com/android/forum/threads/96236/#content - Space Invaders - https://www.b4x.com/android/forum/threads/96263/#content - MultiplePages - A simple example where the template game is hosted in a different B4XPage. Proof of concept projects: - Walking Character - includes all kind of random features. - Lines - https://www.b4x.com/android/forum/threads/96934/#content - Floating bodies: https://www.b4x.com/android/forum/threads/98243/#content Tips - The files from the Shared Files folder are copied to the platform specific folder during compilation. Don't update the files in the Files folder as they will be overwritten (except of files unique to the current platform). Updated X2 Game.b4xtemplate is attached. It includes the manifest line from post #10.
ilan Expert Licensed User Longtime User Jun 2, 2021 #2 That's awesome erel. i believe that xui2d has a lot of potentials it just needs some published games in the store to prove it is a good framework and this will make it more interesting for people. i am planning to make one in the near future.
That's awesome erel. i believe that xui2d has a lot of potentials it just needs some published games in the store to prove it is a good framework and this will make it more interesting for people. i am planning to make one in the near future.
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 2, 2021 #3 After updating; I got this error when opening B4J Space Shooter example: Spoiler: log error Unknown type: b4xmainpage Are you missing a library reference? and the compiler error: Spoiler: compiler error Error description: Unknown type: b4xmainpage Are you missing a library reference? Error occurred on line: 73 (B4XPages) Public Sub MainPage As B4XMainPage What I missed?
After updating; I got this error when opening B4J Space Shooter example: Spoiler: log error Unknown type: b4xmainpage Are you missing a library reference? and the compiler error: Spoiler: compiler error Error description: Unknown type: b4xmainpage Are you missing a library reference? Error occurred on line: 73 (B4XPages) Public Sub MainPage As B4XMainPage What I missed?
andymc Well-Known Member Licensed User Longtime User Jun 2, 2021 #4 If I had the time, I'd love to convert one of my current LibGDX based games to use it. Being able to release on iOS would be great.
If I had the time, I'd love to convert one of my current LibGDX based games to use it. Being able to release on iOS would be great.
Erel B4X founder Staff member Licensed User Longtime User Jun 3, 2021 #5 HAH said: After updating; I got this error when opening B4J Space Shooter example: Unknown type: b4xmainpage Click to expand... You need to download the updated examples: https://github.com/AnywhereSoftware/X2/archive/refs/heads/main.zip
HAH said: After updating; I got this error when opening B4J Space Shooter example: Unknown type: b4xmainpage Click to expand... You need to download the updated examples: https://github.com/AnywhereSoftware/X2/archive/refs/heads/main.zip
Erel B4X founder Staff member Licensed User Longtime User Jun 3, 2021 #6 New example that explains X2Multitouch: https://www.b4x.com/android/forum/threads/xui2d-touchy-example-x2multitouch.131307/
New example that explains X2Multitouch: https://www.b4x.com/android/forum/threads/xui2d-touchy-example-x2multitouch.131307/
Erel B4X founder Staff member Licensed User Longtime User Jun 3, 2021 #7 I've uploaded a quite non-interesting example, named MultiplePages, of a game made of multiple pages. The game itself is hosted in the second page. Note that the correct page should be passed to Multitouch.Initialize (it is important in B4J when intercepting keys).
I've uploaded a quite non-interesting example, named MultiplePages, of a game made of multiple pages. The game itself is hosted in the second page. Note that the correct page should be passed to Multitouch.Initialize (it is important in B4J when intercepting keys).
Erel B4X founder Staff member Licensed User Longtime User Jun 6, 2021 #8 New example: https://www.b4x.com/android/forum/threads/xui2d-breakout-example.131395/
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2021 #9 New example + LargeBackground class: https://www.b4x.com/android/forum/threads/xui2d-large-background-class-example.131589/ Allows drawing the background based on a large image that was split.
New example + LargeBackground class: https://www.b4x.com/android/forum/threads/xui2d-large-background-class-example.131589/ Allows drawing the background based on a large image that was split.
Erel B4X founder Staff member Licensed User Longtime User Jun 14, 2021 #10 All B4A examples were updated and the following line was added to the manifest editor: Code: Copy SetActivityAttribute(Main, android:configChanges, orientation|screenSize) This solves an issue where the activity is recreated in some cases, when the phone screen is turned on while the app is in the foreground.
All B4A examples were updated and the following line was added to the manifest editor: Code: Copy SetActivityAttribute(Main, android:configChanges, orientation|screenSize) This solves an issue where the activity is recreated in some cases, when the phone screen is turned on while the app is in the foreground.
Erel B4X founder Staff member Licensed User Longtime User Jun 14, 2021 #11 New example + ParallaxBackground class: https://www.b4x.com/android/forum/threads/xui2d-parallax-background.131606/#post-829749
New example + ParallaxBackground class: https://www.b4x.com/android/forum/threads/xui2d-parallax-background.131606/#post-829749
khandah Member Sep 10, 2023 #12 I am using B4A, and I see that the module Game.bas is for B4J. Can you help please ? Thank you in advance.
I am using B4A, and I see that the module Game.bas is for B4J. Can you help please ? Thank you in advance.
Erel B4X founder Staff member Licensed User Longtime User Sep 11, 2023 #13 khandah said: and I see that the module Game.bas is for B4J. Click to expand... No. It is a cross platform module. The projects should work as-is. You don't need to change anything.
khandah said: and I see that the module Game.bas is for B4J. Click to expand... No. It is a cross platform module. The projects should work as-is. You don't need to change anything.