Results 1 to 9 of 9

Thread: Bare Game development walkthrough #2: Parallax and other sprites

  1. #1

    Bare Game development walkthrough #2: Parallax and other sprites

    Bare Game, a multiple platform class framework around SDL 2.0, is preparing to release a major new version. To get developers familiar with the project we've updated github with a few minor fixes before the next release. We've also created a new walk through with video and code of the old version. Keep in mind, this framework is quite Bare:

    Sprites example walk through:

    http://www.getlazarus.org/videos/baresprites/

    Previous walk throughs:

    http://www.getlazarus.org/videos/baregame/

  2. #2
    very nice engine
    the sprites example missing images and sounds folders , also require libssl.dll to run (btw what is this dll for ?)

  3. #3
    Thanks for the feedback. The libssl, which isn't normally needed, is for secure sockets (e.g. https) support, as well as crypto functions (any web storage management). I believe all functions which might use secure sockets are binded late, as in only loaded when needed, but I'm probably wrong, as evidenced by your comment.

    Regarding those folders, in the demo they should be created for you when you run the example the first time. See Sprites.Web function WebGet. The example loads assets from the Internet over http when needed, then caches them locally under the program's folder.

    I'll check into that libssl requirement.

  4. #4
    Okay, it looks like I linked directly to ssl libs. I've change it to do late time binding the first time you use ssl or crypto functions i.e. LoadLibrary+GetProcAddress/ this means the problem you mentioned is fixed and there no longer hard requirements for ssl libs on the client machines. Use git pull to stay on top of the latest updates.

    https://github.com/sysrpl/Bare.Game/...4b2?diff=split

    A side note, in some units which depend on external libs, including sdl2 unit and ssl unit, I provide the option to link statically. This means you can build ssl and sdl into your exe directly through lib.a files. The reason I have it off by default is so that systems can have up to date libs rather than potentially stale static libs. In the future I may maintain static lib.a files more frequently.

  5. #5
    thanks , when i execute the app , it only create sounds folder and stay hanging after that ( i wait only 3~4 min). is the resources has a big size ?
    you mentioned that its possible to statically linked with sdl2 , can you show how ?

    thanks

  6. #6
    The assets are maybe 3MB in size. How fast is your Internet? I guess I could make a loading message screen.

    To link statically you {$define static} in at the top of Bare.Interop.SDL2, the problem is you will need libSDL2.a built for your OS/CPU in your libs folder. I can and have created them in the past, but right now I'd prefer to avoid the hassle. If you know how to use gcc, mecrial sdl sources, and setup link config settings before you make, go for it.

  7. #7
    Based on your feedback I added code to demonstrate one way to make a loading screen. Use "git pull" and sprites will now shows download progress as it gets each assets from the Internet. If you already downloaded image and sound assets once, the loading screen won't display. To get it to display, delete the assets in the program's folder and run it again.

    If anyone wants bonus points, change the loading background color and draw a progress bar with Canvas and Pen.

  8. #8
    thanks , it works now , very nice graphics .
    about static linking , i download libsdl.a from http://libsdl.org/release/SDL2-devel-2.0.3-mingw.tar.gz , when i try to link it , fpc say " Error: Illegal COFF Magic while reading libsdl2.a"

  9. #9
    I'll get static linking working again someday. Also, if you want "git pull" again, I moved Internet loading and progress bar rendering to Bare.Example, then included its usage in the sprites example. The progress bar is drawn using Canvas.Path and Pen.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •