Hello there,
I polished the graphics a little bit using gideros shape class only. Not a single image here B-)
Plus I used "object-oriented" programming instead of putting everything in the level 1 class. I created classes for bird, npc1, river, clouds.
I will post the demo on github so you can tell me if the way I am coding is good enough or could be improved.
Thank you.
Comments
Could you please have a look and tell me if I am doing things right according to gideros standard?
https://github.com/mokalux/gideros/tree/master/shmup
I have a doubt about TNTVirtualPad and the hero part. I am creating VirtualPad in the level class and calling functions in the hero class. Is that right?
Thank you in advance for your time.
https://deluxepixel.com
I will have a look at that for sure. Thank you sinistersoft.
Do you think that could do for a gideros 2019 yt tutorial series?
I feel like I need some more practice though.
I know it's an accomplishment to use the Shape class for everything but that will cause performance issues down the track. I wouldn't recommend anyone to use a lot of Shape instances in their games.
I'd also recommend looking at 2d vectors for anything that is related to positioning. Here is some information on vectors from my unfinished Gideros book..
Better Movement: Vectors
Storing the variables inside the game object (as in the previous example) is fine and you can continue with that if you wish. However.. if you look about the internet you will find all manner of game coding tutorials and when it comes to moving game objects about you will soon discover that almost everyone stores the related variables inside a construct called a vector. Because nearly everyone else is doing it, you should also do it, because code from another source is always easier to integrate into your own codebase if it shares the same (or similar) basic data structure. Vectors can be manipulated with vector math so you can calculate the distance between vectors, the angle between vectors, and much much more. So what is a vector?
In mathematics, physics, and engineering, a Euclidean vector (sometimes called a geometric or spatial vector, or (as here) simply a vector) is an object that has magnitude (or length) and direction. Vectors can be added to other vectors according to vector algebra. A Euclidean vector is frequently represented by a line segment with a definite direction, or graphically as an arrow.
In most game engines, you will find a vector as a description of its 3 components X, Y, Z. For your 2 dimensional games however the Z component will be omitted because it is not required. Time to get right to it and create a few vectors for position and velocities.
local position = {x = 0, y = 0}
local velocity = {x = 0, y = 0}
As you can see a vector is just a table containing variables that correspond to the axes we require. Go ahead and rewrite the previous example that uses vectors for position and velocity.
Listing 110 Moving objects using vectors
It might not seem like it now but vectors are going to be of use in so many ways later-on.
Likes: MoKaLux
I know that in godot (yep I used it), everything is done using vectors. I think that doing so in gideros would be the right choice. The yt tutorials would have to wait until I get better at gideros.
Thank you very much antix for this and I am looking forward to reading your book.
btw you can also juice it up with particles and other stuff
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I just want to mention one thing, I am not doing a complete game here. I am learning gideros and lua best coding habit/good practice.
Then I may do a youtube tutorial series to show that gideros is kicking asses! The lack of tutorials is something I want to help you guys with. But they must be good tutorials.
Likes: SinisterSoft, Apollo14
I've got a ton of classes now that I just include in every new project (which really is a project template that I copy and then rename). This gives me my splash screen, a main menu, and a game scene.. without having to type a single line of code. This IMHO would be what you are working towards so you can make prototypes rapidly.
Likes: MoKaLux
Once you find a piece of code that you like, you put it in your myclass.lua and reuse it over and over. The template is also a good idea.
I put myclass.lua into a separate folder and in my projects I simply link to the classes I need.
Thank you for your advice.
Likes: antix