Hello Everyone!
I want to create a game. I don't understand many things, I've recently started working with B4A. I have a lot of questions, and I thought instead of cluttering up the forum, I'd post my questions under this post. In the future, these would cover different topics. I think it's a good solution to ask questions about various topics here, under one post, so those who want to create a game in a similar way would get help in one place. Plus, I'm happy to answer anything myself.
I didn't make an internal recording so you can see the controls. I hope it's an ideal, easy solution, and I'd like feedback on this as well. I want to make it as ergonomic as possible. I admit, I'm not good at it in any way, even though I've tried many control layouts. The latter seems to be the most ideal for us. There's nothing better than 'wasd+mouse' on PC! But life is limited on mobile.
I'd especially like to ask about OpenGL. Let's start:
(pack is too large here)
I want to create a game. I don't understand many things, I've recently started working with B4A. I have a lot of questions, and I thought instead of cluttering up the forum, I'd post my questions under this post. In the future, these would cover different topics. I think it's a good solution to ask questions about various topics here, under one post, so those who want to create a game in a similar way would get help in one place. Plus, I'm happy to answer anything myself.
I didn't make an internal recording so you can see the controls. I hope it's an ideal, easy solution, and I'd like feedback on this as well. I want to make it as ergonomic as possible. I admit, I'm not good at it in any way, even though I've tried many control layouts. The latter seems to be the most ideal for us. There's nothing better than 'wasd+mouse' on PC! But life is limited on mobile.
I'd especially like to ask about OpenGL. Let's start:
- How can I draw over OpenGL? Can I use 'canvas, b4xcanvas'? I couldn't make it work.
- How can I place a 2D texture over OpenGL graphics? I want a solution that would show crosshairs, energy, and other information with semi-transparent textures. I don't want to place separate panels, which would decrease the size of the 3D window. It's funny because I managed to implement 3D rendering (because I found a sample program and understood it), but I can't do 2D rendering (how to put a simple image over OpenGL). So overall, what I want is very simple. I want to draw and write over the graphics.
- How do I know in the program how fast rendering is happening? The actual redrawing.
- How can I make the background of the loaded image disappear? For example, if the background is rgb(255,0,0) red, then make it completely transparent (alpha=0). From line 524, you can see that I tried. I left the code in. It doesn't work. No matter how I try, it gives color to the background instead of making it disappear. This is the texture of the bullet I shoot. So for now, I'm left with a triangle-bullet.
- I'm uncertain. There are elements that don't move. But there are those that do. My knowledge extends to the point where I reload all the vertices every render. Since I don't know OpenGL, I'm afraid I've also calculated those vertices unnecessarily, which don't change. The thing works like this, but I'm not sure if I'm unnecessarily burdening the CPU. The drawings that don't change are in lines 614-623. Those that always change are in lines 624-637. Would it be faster if I only load the parts that don't change once? Or is it insignificant? Unfortunately, I'm not clear on this, so I welcome any thoughts.
(pack is too large here)