Greeting Hello everyone!
Godot - surely you have heard about this game engine, but have not dared to try it?
How is it so, I've been using unity for so many years, all bloggers say: UNITY.
And this is some kind of unnecessary Godot.
Yes, that's exactly what I thought, until I decided to try it out myself and create
my own clone of the popular Arkanoid game.
But, simply creating a game would be a bit boring and I decided to hold a duel between
two game engines: Unity Vs Godot.
I will create 2 identical games on 2 different engines and summarize what was difficult and
what was easy when creating games on these engines.
I see no reason to continue this introductory speech, let's move on to development!
Graphic A very important part of creating a game is
drawing graphics.
You might ask what is needed for Arkanoid - a ball, a rectangle and a platform.
But I wouldn't be me if I hadn't done something truly great.
(I'm drawing on an easel).
That's how I drew the graphics for our future games.
Godot Development 1 In the same way as in Unity, the first thing
you need to do is create a project, and in the project folder all the folders we need
to store scenes, images, scripts and other things.
If you don't even do that on unity, do it.
I moved our graphics to the folder with pictures and started creating a moving platform.
It was pretty simple.
To do this, I had to create a scene inside which I created an Area2D object, I can't
download exactly why, but I know that it needs to be added.
I added sprite and CollisionShape to the object we created.
I set everything up and we already had a platform ready, which could, which could, which could
not do anything yet.
In order for us to move it, we will need to write a small script.
Godot supports writing code in programming languages such as GDScript, c# and c++.
Initially, I planned to write code in c#, but then I changed my mind, since gdscript
is almost no different from python, and I haven't made games on it yet.
Right-click on the Player and create a new script.
First of all, I declare 2 variables, one of which is public and contains the speed of
the platform, and the other is non-public and does not contain the speed of the platform.
Next, I write a function that says: If the right button is pressed and our character
does not touch the edges of the screen, then he moves, similar to the situation with the
left button.
We also prescribe a function that stops our platform if you want to go beyond the edge
of the screen.
And that's it, now we have a moving platform.
Unity Development 1 Folders for our project files have been created,
graphics have been moved to them, what should we do next?
Drag the image of our platform onto the screen.
We adjust it to the desired size and add Rigidbody2D, without which it is impossible to move the
platform, as well as collider, to be able to come into contact with other objects.
We create a script, attach it to our platform and go to edit it.
I will not analyze the scripts in detail anymore, because it will take a lot of time, and we
are all busy people here.
Therefore, I will tell you briefly – I did the same thing as in godot, only using more
lines of code, since this is c#.
The platform is ready, and as for me, its management is no different from the management
of the platform created in godot, to which I propose to return to create a flying ball
and walls.
Godot Development 2 A platform that can't go beyond the edges
of the screen is made, but it can still go beyond it.
Why?
All because I have not yet created blocks that will be located at the edges of the screen
and keep our platform in our visibility zone.
Perhaps there is a way to do without the auxiliary creation of walls, but I have not found it.
In general.
I create a new scene, and add a new element there, to which I set all the parameters necessary
to perform the functions of the walls.
After that, I convert our scene to tilemap and draw these walls on the main playing field.
Now our platform will definitely not go beyond the edges of the screen, so the ball will
also have something to start from.
Speaking of the balloon.
For him, I also create a new scene, do everything the same as for the character and move on
to writing code, which this time will be more.
(writing code) Unity Development 2
In Unity, I also made walls, but transparent, and it was a little easier than in Godot.
Then he just moved our ball to the stage and endowed it with magical abilities, namely,
the ability to fly, break walls and break blocks, which are also not there yet..
Godot Development 3 Blocks, yes, definitely need to add blocks
that will break when colliding with our ball.
For them, we create another scene, quickly assemble the main components and write a couple
of lines of code, after which we begin to place our bricks on the stage.
Lo and behold, now it really looks like Arkanoid.
How are things going with Unity?
Unity Development 3 And everything is fine on Unity.
I also added blocks, but just without creating a separate scene for them.
I wrote a script and made a prefab out of it.
After that, I began to place them on the stage, and oddly enough, everything works fine after
the launch.
Conclusion That's it, 2 identical games on 2 different
engines are ready, it may have seemed to you that it was harder to make a game on Godot,
since I told you about it longer than about Unity, but in fact it's not, I just spent
more time on this engine because Unity is more famous and you've probably already seen
how games are made on it.
In Unity, it took me 2 hours to create the game, in Godot - 3, except for a few more
hours spent on the Internet searching for solutions to some problems.
I can say with confidence that Godot is a good engine, and Unity has been for a long
time ... (the trunk was distorted).
And Unity was the best, and it remains so.
See you in the new video!