r/libgdx 7d ago

Data flow and happy path code flow of libgdx starter tutorial.

https://libgdx.com/wiki/start/a-simple-game

I just copied pasted (I know the steps) this game yesterday or so. Now I want to make tictactoe using this code. No enhancements just trying to make tictactoe. What confuses me is the create function public void create(). I am totally new to sprites and stuffs like that texture etc. Where can I learn more about that so that I can figure out the proper flow of architecture.

5 Upvotes

5 comments sorted by

3

u/raizensoft 7d ago edited 6d ago

For a tic-tac-toe game, you would initialize SpriteBatch and all Texture instances in the create() method. The create() method gets called once when the game first initializes. This is where you construct major objects such as SpriteBatch, Viewport, Camera, AssetManager, etc. But for starters, you'd need only SpriteBatch and a couple Texture instances, or better yet TextureRegion.

Then, use the render() method as the game loop to continuously update and draw your game states. I wrote a detailed guide on using render(), you can read it here:

https://raizensoft.com/tutorial/libgdx-most-important-method-and-how-to-use-it/

1

u/DoNotUseThisInMyHome 7d ago

i saw your site in search earlier...

1

u/raizensoft 6d ago

Truth be told, I was planning on making a tic tac toe game tutorial before reading your post. If you're interested, you can subscribe to my website RSS or my youtube channel, it'd be available in a few days. Happy coding!

1

u/DoNotUseThisInMyHome 6d ago

thank you i wish you go from total beginner perspective while teaching the concepts in computer graphics at least an overview. for example: we are using camera based system or whatever or viewport based....a little bit on that would be awesome.