# My technical notes - Cataurant
## Things that I learn while coding this game
### 1. GitHub Actions
### 2. Using SDL2 API
### 3. Git
## All my stupid mistakes
### 1. Load texture to each pieces of ingredients
**Problems:** In 05/04/2023, I made a very stupid mistakes. I created a class `Ingredients` with `Texture` in it. Each pieces of ingredients had their own texture. When creating new ingredients, I reloaded the texture. Therefore, the game was too lag and delayed.
**Solve:** I figured out 2 ways.
- `The first way`, load all textures at the beginning of the game and create a class `Ingredients` with `ptrTexture` and `typeIngrediets`. Just update the `ptrTexture` when adding new ingredients.
- `The second way`, class `Ingrediets` only have `typeIngredients` and extern all textures. Write a function to render ingredients. So, just have to call this function. This way is better than the former way because it use less memory and time.
## Things that I want to do
### 1. Using Emscripten to run game in browser
**Problems:** I am concerning that running my game in browser is not a good idea. I watched some YouTube videos and tried some SDL2 games running in broswer and then figured out that it is too lag despite of its simplicity. Moreover, I have to include emscripten libraries to my code but I don't want to do that. It may make my game run less smoothly.
### 2. Add more languages
**Problems:** After searching in StackOverflow and some websites, I concern about the compatibility of Unicode fonts with Linux and MacOS.
### 3. Using SDL2_net
**Problems:** My knowledge about networks is not enough to do this now. I will do in future.
