Brave Octopus Adventure — brave octopus is ready to conquer your Android smartphones


Hello. Not so long ago I had some free time, which suddenly coincided with the time when I wanted to do something different, honey.
What your might want to make an ordinary programmer? Of course the game!
Under the cut is my little story is hardly enlightening or extremely exciting, but, nevertheless...

It all started about a week ago. I was basically a lot of programming experience in General, and there was practically no experience in igrodely. Somewhere a year or two ago, I put myself Unity3D, in order to see what kind of animal, so that from the development tools was chosen as the only one familiar to me. Could still of course on the canvas to draw, but I decided that, perhaps, not worth it. From this initial experience left me some memories about gameobjects, components and what you can do orthographic camera to do a 2D game in Unity3D. As it turned out, the current versions of unity (since 4.3) added support for 2D out of the box, which I was overjoyed. Now the process of creating a game object is to drag a sprite on stage. Sprite even skalitsa for different screens, though I don't know the width he does it, the height or General area (or maybe sqrt(area)?).
Here is very terrible and ugly the initial sketch of the game screen.

Yes, it was conceived as a platformer in the style of prehistoric Impossible Game.
IT was drawn in a fit of inspiration when I suddenly decided that I can do anything. Showed it to a couple people took off the rose-colored glasses and began to think. Because the development budget has been allocated no, the role of the artist/designer was determined my 12-year-old sister.
Here redrawn her example. It seems to me better. And the fact that children's graphics, because games do to children, right?

So began the development process.

Big mistake

The first mistake I made almost immediately when thinking about the designer levels. After some thought I realized that the unity is a wonderful designer. And after adding to the stage all the desired objects in the right places after the level was playable and tested, I ran it on my nexus 5 and not weak saw the fps about 5-10. It turned out that was not a very good idea to add to the scene all at once approx 400 objects-obstacles. That was how I wrote 2 scripts, one of which reads all of the objects, their position and the angle of rotation from the stage and recorded everything in a text file, and the second subsequently read this file and create objects on the fly, when it was their time. Now there exist 50 objects and the nexus felt pretty good, which could not be said about the jiayu g2.

a Big mistake two

It should be noted, how began to develop. I started with the in my view is simple — with dynamic background. Ie we have 2 sprite, which follow each other, and when the left is out of sight, he rearranged the right and an endless conveyor of two sprites moving on. And this was the reason for the subsequent blunder I was moving not the player relative to the background, and Vice versa. Accordingly, when they began to emerge new objects, they also moved together with the background, and the player continued the rest of the x-axis And then need to say thank you this list of the 46 most frequently occurring errors. It turns out that you can not move the collider (a component that tracks collision) without a rigidbody (component that is subject to the laws of physics; well, not really all). I.e., in their councils, this list comes even before, that if similar objects are created from code, you need to create them first, then move where you want and only then hang them on the collider. And I have all the obstacles in the game just represent the colliders without a rigidbody. And given the fact that the background moves with respect to a player... had to redo it. Now move the player and camera on the jiayu g2 game also runs quite smoothly.
Not such a big mistake

There were less large-scale failures. For example, given here is the location of colliders:

The lower of which tracked touch the ground and all is well, and the top led to a quick and painful death, was unacceptable to the player slipped through the barrier and touched the top of the Collider. In the settings, there is a corresponding checkbox, which sets the continuous detection, i.e., it would seem, just what we need. But it works only with physics if the player is jumping and falling according to laws of physics, but here this is unacceptable, because in that case, sooner or later will be offset when jumping and the player will fall when he does everything right.
In the end, now, with the fall run 2 beam, like these here:

If one beam will collide with earth, and the second with a spike, it is counted as touching the ground. And the finish, for example, a priority of the earth. And calculates the touch.

Audio

For the music thank you kind people fma which release it under creative commons.

Results

Phew. Free time comes to an end, I have some completed project (generally all endeavours to stop somewhere in the middle). About unity, given the initial knowledge I now know in almost an infinite number of times more, but it is still very small. I still can't shake the feeling that all this could be done much easier and prettier.
And here, in General, the game itself — happy birthday.

I almost forgot! E in Android since version 4.4 became available the video recording of the screen through adb. So I could for 10 minutes in a vacancy to concoct a no video.


PS Anyone still reading this site thank you so much!
You may think that it's a little hack for a few hours, but I spent a week of his time, and it was hardly a standard work week, rather it was like the last day before the deadline. Every day. No, most this is like a hackathon a long week at. In General, I went to the nature to recover. All once again thank you for your attention, I'm tuckered out.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

The release of the new version of the module modLivestreet 0.3.0-rc

mSearch: search + filter for MODX Revolution

Emulator data from GNSS receiver NMEA