Share My Creation Objects in B4a - No problem ;-) - O yes, and a simple 2D game engine ...

ssg

Well-Known Member
Licensed User
Longtime User
lol... the ideas are starting to trickle in!

I'll announce my projects once i get them completed

and yes.. the render speed is way smoother now!

excellent work! and thanks for sharing!!
 

francoisg

Active Member
Licensed User
Longtime User
Thank you!
Glad someone else might find a use for it - and about the sharing ... hel, I need SOME way of enjoying my work, so I need to play every now and then as well ;-)

When I started programming (many years back) it was ALL fun - now it's a job!

Anyway, back to work I guess ....
 

ssg

Well-Known Member
Licensed User
Longtime User
A couple of fixes for the code:

1 - Dim tmr As Timer should be in process_globals, currently you hit an error if u exit the game and start it again.

2 - your other variables will need to be reset again, so i'd change the activity_start to the following:

B4X:
   Activity.LoadLayout("layout_main")
   
   Activity.AddMenuItem("Exit", "mnuExit")
   Activity.AddMenuItem("Reset", "mnuReset")
   Activity.AddMenuItem("Change Background", "mnuChangeBackground")

   gwcanvas1 = GWCanvas.Create(Activity)
   LoadBackground      
   LoadSprites
   If FirstTime Then
      tmr.Initialize("tmr", 10)
      tmr.Enabled = True      
   End If

Do highlight if i've done something not quite right above... cheers!
 

francoisg

Active Member
Licensed User
Longtime User
150 sprites, all at the same time, and it actually works? better than I expected ;-)
I have updated the example code with some changes (as well as the suggested changes by ssg) ... the planes will now "explode" instead of just disappearing, shows of the "animation" capabilities of sprites as well...
 

Attachments

  • SopwithDemo.zip
    270.5 KB · Views: 597

magarcan

Active Member
Licensed User
Longtime User
Any updates?? I'm looking for any game dev library and this is the only I've found. After reading about this, it seems to be really powerful. I'll test this at home.

Thanks!!
 

Kamac

Active Member
Licensed User
Longtime User
Unless you need 2d physics or just 3d features, then it's the best just to write your own small engine, during game creation

If you want a 3d 'engine' then it's avaible at OpenGL ES topic which contains the library itself. There are samples posted by Jim Brown and someone else, and they do great as small engines! (I've used one myself for 3d)
 

magarcan

Active Member
Licensed User
Longtime User
By now, I only want to play with 2D. In that case, do you know where can I find some info in order to begin develop my own engine???
Thanks!!!
 

DoogieDog

Member
Licensed User
Longtime User
Cannot run Sopwith demo with trial edition ?

I'm thinking of buying B4A for game making and worried about having alot of sprites animate correctly. I found this great demo, but cannot run with the trial version. This is the compile error.

Error parsing program.
Error description: Unknown type: gwcanvas
Are you missing a library reference?

Am I correct that the trial version does not support libraries, or have I set up the project incorrectly?

DD
 

francoisg

Active Member
Licensed User
Longtime User
No additional libraries are needed for the demo (all the code is included in the download) - should work fine with the demo version of B4A ...
The GWCanvas type that it is complaining about should be located in the GWCanvas module. The module file should be in the same directory as the rest of the project.

I see there is a bit of a problem in the demo when used on higher res (960 x 540 for example) devices (background & ground issues) - will post a fix as soon as possible ...
 

DoogieDog

Member
Licensed User
Longtime User
Startup Error when opening Sopwith.b4a the first time

This is the error I get , then a subsequent buy me screen

This project includes multiple code modules. This feature is not supported by the trial version

Darn it!

DD

BTW - Awesome software so far!
 

francoisg

Active Member
Licensed User
Longtime User
ok,
that makes sense ;-)

Sorry, then I guess I can't help you:sign0148:

I'd say, bite the bullet and buy the cheapest version you can. Should let you experiment enough to be sure if it will work for you or not???

BTW: There is a new version available for download now, with the resolution bug fixed ...
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…