Source Code for my rpg game

GitHub - LowWah/WwI-Solar2D-Redacted

I couldnt find any other examples of rpg games and i think Solar2D is somewhat niche so i thought id share my source code.

This is a menu-based rpg game with turn-based combat (think mobile games so yes its gacha), it does not have overworld movement, it does scene transitions/ events by clicking rectangles.

I think this game engine is very easy to use, the API’s are well documented and I like the scene manager (especially overlays), but i do have some issues (mostly graphics related) so if i develop this game further i wouldnt use Solar2D.

No encryption on images - I know its impossible to 100% protect your resources, but if i have paid art (or other resources) i would at least want some difficulty of sharing. I believe most other game engines have some encryption functionality, from what I saw Love2D can read bytes so you can read encrypted bytes, decrypted and load it with the same api. Solar2D is restricted to file location only, so you need to read it, decrypt, save it, load image, then delete it which is a bit more tedious (or at least thats how ive done it, not sure if there is any other way). I have no idea on audio as i didnt bother include it in this project

Graphics sheet borders - When i load a frame of a graphics sheet, there is a small border which i believe is 1 pixel of the adjacent image and im not sure if its intentional or not. The fix would be to adjust all spritesheets to have a 1px border around it, but you would have to adjust coordinates etc

Text slightly shifts when changes - Ive noticed that when i change a text, e.g from 20 to -20, it gets slightly shifted, so its not just a - appearing. However I do have some wrappers for creating texts which do things like change anchor and scale, so it could be because of that, im not too sure

Scrollview - I have issues with scrollview. The children are under a _collectorGroup instead of the usual display group object (e.g scrollview[1]) which is not documented anywhere, i have no idea how to permanently show the scrollbar (did not try to do a scroll bar sheet so dunno if that fixes it), scrollTo with time 0 sometimes doesnt work (though when i cancel transitions i just do cancel all so maybe it conflicts with that, not sure)

Howdy!

You can package your images using Binary Archive. It doesn’t extract the images to disk when using them and also has encryption available.

Side note, the (NEW) WwI.zip (v1.01) does not load properly for me:
image

Thanks for letting me know about the error. I had the same error when i tested on another computer, i have no idea why it worked on mine… Ive updated it, so you can actually try out the game now (hopefully…)

It was related to the encryption stuff, so if i knew about your package i wouldnt have had this problem. Is this something you wrote yourself or its part of solar2d, i didnt see any references to it on the main page, so im guessing you did it yourself. probably would be useful to link it somewhere

I might try it out if im updating it some more

New version works. :slight_smile:

The module I wrote is not part of the core and it just takes advantage of existing plugins through which data can be fed to the engine from memory.

You already got quite a bit done on your project, you can either use the module as is or grab any part of the code to do your own implementation.

image
I had a problem with the encryption module, I tried fixing it to an empty string but it still didn’t work.

Sorry, maybe it wasn’t clear but you won’t be able to run the project. I have intentionally removed all images and the encryption keys as some resources are paid I don’t want to share it easily. I probably could replace those images with placeholders but not bothered honestly, I just wanted to share my code in case people wanted to see how I did things code wise. Though maybe it’s pointless since it doesn’t run

I advise you to replace the images with placeholders. I think it’s more appropriate.

i have updated

1 Like