Simple XUI B4A vs B4i vs B4J game tutorial examples with source code coming soon 👀 for newer B4X developers

Peter Simpson

Expert
Licensed User
Longtime User
Hello all,
I've written more about these example in the YouTube description, so for now please click on YouTube link to find out more.

I'll be releasing both B4A and B4i source code examples in the near future, well that's when I can find the time to put some comments in the shared code modules (2 of the three code modules are shared). I'll probably not be releasing the B4J source code as even though it can easily use the same 2 shared code modules as B4A and B4i, I developed the B4J version separately just to see what the end results would look like.

Desktop screenshot
desktop.png


Desktop vs iOS
ios_vs_desktop.png


Desktop vs Android
android_vs_desktop.png


Watch this iOS vs Android YouTube video



Enjoy...
 

Alexander Stolte

Expert
Licensed User
Longtime User
i did long time ago a tic tac toe game for aged 60+ 😁
:p
 

Peter Simpson

Expert
Licensed User
Longtime User
Thank you for that @Alexander Stolte :)

I remember that game now @ilan, how is it going on the stores?

As you can see this version of TTT is just a supercharged version of Erels original. Code wise I've tried to make it as simple as possible for new to B4A developers to follow the source code, when I get time I'll write comments throughout the code modules before releasing the B4A, B4i and maybe also the B4J versions.

I've actually enjoyed playing about with shared codes modules (this didn't take long to do), as in my usual day to day work I don't have to share code modules between multiple platforms. Anywhere Software has done a really good implementing sharing of code modules throughout the packages.
 

ilan

Expert
Licensed User
Longtime User
I remember that game now @ilan, how is it going on the stores?

not very well. but i did enjoy making this game. it was my first (and only) multiplayer game i did that run on 2 different devices.

Anywhere Software has done a really good implementing sharing of code modules throughout the packages.

yeah, thats very true :)

keep the good work, it will help a lot guys here for sure!
 

Peter Simpson

Expert
Licensed User
Longtime User
Very, very nice, Peter.
What lib did you use to connect the devices?

Thank you @asales, I do appreciate the positive feedback as it just makes me want to create more simple XUI examples for newer B4X developers to learn from on the forum.

I'm using jNetwork (B4J), iNetwork (B4i) and Network (B4A), all three are communicating using UDP. The first 2 TTT games that are started will automatically find the other device by using the network broadcast address, then the two devices sends each other their unique IP addresses so that they can send their moves back and forth directly to each other. There's absolutely no need for the end users to manually enter the opponents IP address or select the opponents device from a list.

I wanted to create something that would be simple enough for newer B4X developers to follow once they read the code (which I'm hoping to release next week once I have tidied it up a little bit).

BTW after creating the video, I decided to add 'ImgXO(Clicked).SetVisibleAnimated(500, True)' so that when I user clicks on a blank square the O/X fades in slowly.



Enjoy...
 

rabbitBUSH

Well-Known Member
Licensed User
games that are started will automatically find the other device by using the network broadcast address, then the two devices sends each other their unique IP addresses so that they can send their moves back and forth directly to each other.

Goodness -> they're BRIGHT 💡in Birmingham this week -> that's neat -> two un-broadcastable words (FM) come to mind.

in our parlance -> YOH! good one. . . . .Mate

B4X:
how many devices at a time?

I wanted to create something that would be simple enough for newer B4X developers to follow once they read the code

Can't keep up with your other prolific offering already -> not sure if this newer-B4X-er will follow that -> still basically in the Turing Black Box 🕯
 
I wanted to create something that would be simple enough for newer B4X developers to follow once they read the code (which I'm hoping to release next week once I have tidied it up a little bit).

Hi, just waiting to see B4J vs B4A source codes to learn and create cute little games for my kids. Please upload ASAP. Thanks.
 

Peter Simpson

Expert
Licensed User
Longtime User
Hello all, I've finally released the code tutorials.
I've been waiting for Anywhere Software to release the newest version of B4A (V9.90) so that I can use the newly updated Network v1.52 library which now has the GetBroadcastAddress method included. Please download and install B4A V9.90 or higher before trying out the B4A code example in the links below.

Thank you @Erel for updating the B4A Network library, once again your support is second to none.

Sorry, no B4J tutorial as I don't fancy releasing the code as it just complicates the code in the two .bas shared code modules. But if you study the B4A and B4i code thoroughly, you will find it extremely simple to create the B4J version. I rewrote my code examples above to use Erels original game example but with some changes.

B4A tutorial

B4i tutorial



Enjoy...
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
I am a bit confused, isn't the newest version V9.80? This is written on main page.

You can download B4A V9.90 BETA #2 now, give it a go. Click on the first link ;)



Enjoy...
 
Top