3×3 POC to production.

I started the 3×3 game as a POC of an old game idea, but I’m starting to like the game, so I have decided to spend some time adding to it, polishing it, and see if I can make a decent game out of it. 🙂

This means that I have to find some music, sound effects, make some better looking graphics, and what I find hardest of all – make the menu system! I’ll keep it as simple as possible.

3x3 POC version 6

3×3 POC version 6

After I did the DNH game for the GIG 2013, I will not be making an online highscore list. I might do a cookie based one, so the players best score will remain between sessions, but that’s it.

One thing I would really like, is a better player controller. As mentioned in “Player movement script for the 3×3 POC” the motion is done in steps and you can’t move diagonal or change direction while moving. This I need to do better. And I will 🙂

Lets see where the game takes me.

– Henning

Player movement script for the 3×3 POC

I just wanted to show how I chose to do the player control script. After playing the game some more, I’ve decided that the game isn’t going to work on the mobile devises. The swipe to move the player would be very counter intuitive after level 8.

For the movement script, I wanted the player to move in a continuous motion and not in discreet jumps. The player should also be able to keep moving in one direction holding down a direction button.

To keep track of what the player is doing, I first made an enum with the possible motion states.
I guess the enums are self explanatory 🙂

enum Moving
{
    NO,
    UP,
    DOWN,
    LEFT,
    RIGHT
};

Now the the logic. If the player isn’t moving, check for player input.

        if (direction == Moving.NO)
        {
            if (Input.GetKey(KeyCode.A))
            {
                direction = Moving.LEFT;
            }
            if (Input.GetKey(KeyCode.D))
            {
                direction = Moving.RIGHT;
            }
            if (Input.GetKey(KeyCode.W))
            {
                direction = Moving.UP;
            }
            if (Input.GetKey(KeyCode.S))
            {
                direction = Moving.DOWN;
            }
        }

Now if the player is moving, the enum will be holding the direction of motion and we can move the player.

            switch (direction)
            {
                case Moving.UP:
                    if (moveLeft > 0f)
                    {
                        Vector3 v3 = transform.position;
                        v3.y += movementSpeed;
                        moveLeft -= +movementSpeed;
                        if (v3.y > 1f)
                        {
                            v3.y = 1f;
                            moveLeft = 1.0f;
                            direction = Moving.NO;
                        }
                        transform.position = v3;
                    }
                    else
                    {
                        moveLeft = 1.0f;
                        direction = Moving.NO;
                    }
                    break;
                case Moving.DOWN:
                    if (moveLeft > 0f)
                    {
                        Vector3 v3 = transform.position;
                        v3.y -= movementSpeed;
                        moveLeft -= +movementSpeed;
                        if (v3.y < -1f)
                        {
                            v3.y = -1f;
                            moveLeft = 1.0f;
                            direction = Moving.NO;
                        }
                        transform.position = v3;
                    }
                    else
                    {
                        moveLeft = 1.0f;
                        direction = Moving.NO;
                    }
                    break;
                case Moving.LEFT:
                    if (moveLeft > 0f)
                    {
                        Vector3 v3 = transform.position;
                        v3.x -= movementSpeed;
                        moveLeft -= +movementSpeed;
                        if (v3.x < -1f)
                        {
                            v3.x = -1f;
                            moveLeft = 1.0f;
                            direction = Moving.NO;
                        } transform.position = v3;
                    }

                    else
                    {
                        moveLeft = 1.0f;
                        direction = Moving.NO;
                    }
                    break;
                case Moving.RIGHT:
                    if (moveLeft > 0f)
                    {
                        Vector3 v3 = transform.position;
                        v3.x += movementSpeed;
                        moveLeft -= +movementSpeed;
                        if (v3.x > 1f)
                        {
                            v3.x = 1f;
                            moveLeft = 1.0f;
                            direction = Moving.NO;
                        }
                        transform.position = v3;
                    }
                    else
                    {
                        moveLeft = 1.0f;
                        direction = Moving.NO;
                    }
                    break;
                default:
                    break;
            }

That’s it, not pretty but it works. If I have the time, I would like to make the motion even more fluent. The state change if you keep a key down makes the player give a little jump/jitter as the state goes through NO state before returning to a moving state. But for now it gets the job done 🙂

All feedback is welcome, I can’t change if I don’t know what to change. 🙂

– Henning

3×3 POC version 4

The POC is really starting to look like a game. 🙂

New things added:

  • New texture. I only use one for all surfaces.
  • Rotation to selected box, to make it visible to the player what box is selected.
  • More states to the box objects, to make possible removal animation aso.
  • Color click logic, basic game mechanics .
3x3 POC version 4

3×3 POC version 4

The plan is to make the game run on my old HTC Desire, to learn the mobile part of unity. So for now I’m trying to keep everything to a minimum as not to drive the Desire to it’s knees.

Next things to add:

  • Mobile input part, to see if I can’t get the click and swipe part to work.
  • Light bound to the box, to illuminate the boxes in the distance, and I might remove the current spotlight..

 

Future things to add:

  • Sound effects.
  • Music.
  • Score system. How fast you remove boxes, or something like that, have to think about a good way to differentiate different users abilities.

 

Here you can play version 4, and as before, click to remove blocks and navigate using wasd.

– Henning

3×3 POC version 3

OK, finally had some time to try some more things out with the 3×3 idea. So now the colored boxes are boxes and not just generated quads, they are clickable and have box colliders and so does the camera/player, so if you hit a box, it’s game over, and for now you have to restart the game to play again. Also you are now able to hold down a key (wasd) to keep moving in that direction.

I added some game states but only use playing and dead for now.

3x3 POC version 4

3×3 POC version 3

Next I would like to make the color selection part to only allow you to remove boxes of same color, so if you click a blue box you can only remove another blue box. If you click another colored box the first selected color will change to this color.

Here you can play version 3, click to remove blocks and navigate with wasd.

– Henning

3×3 square game.

Yet another game idea. This time, a combined mouse and keyboard racer. The idea is to have a 3×3 colored board coming towards you (the feel should of cause be you race towards it), and you have to click two matching colored squares, and they will disappear, and you have to fly trough one of the hole left by the removed squares. The 9 square are to be colored using 1-8 colors, so there will always be at least 2 matching squares. the use of one color is level 1, and 8 colors level 8. The speed by which the squares are flying towards the player, will of cause increase over time.

Play the first proof of concept, it has only a simple wasd control and that’s about it.

3x3 first proof of concept

Proof of concept, screenshot of the game 3×3

I have to do more tests to see if this would be a fun.

– Henning

How simple a game can I make.

Every new game developer, asking “What’s the best advice when starting game developing?” are often told “Make lots of games” and “Start simple”, so when I saw this small Ludum Dare 26 entry called Tiny Runner by Jarcas Studios I was amazed of the simplicity of the game. So I had to try to make something even simpler, and at the same time I could test a simple character 2D controller 🙂 After a couple of hours I had this.

And yes I did all the graphics myself 😉

If you really want, you can play the game here.

– Henning

Procedural Mesh Generation in Unity.

Mesh Generation in Unity

I come from the good old OpenGL way of doing things and like the control I had with the simple geometry, so when I stumped upon gMaN Ji’s youtube video “Unity Tips and Tricks: Procedural Geometry #1 – Basic Quad” I had to make a small test to see how fast and easy it would be to do.

So hers what I got playing around a while:

It’s was made with 25×25 meshes with part of the full texture mapped to each mesh, and then I just added some random rotation to them. Didn’t want to spend a lot of time making the rotations look good, as it’s just a test. But the possibilities made possible by having this amount of control are limitless 🙂

– Henning

Don’t Fall Asheep Progress 2013-04-29

Only had a very short time to work on the project this last week, so only added very simple movement for the sheep based on global position and Math.Sin, not pretty but it works and still, it’s only for prototyping.

 void Update()
    {
        Vector3 v3 = transform.position;
        v3.x += 0.05f;
        if (v3.x >= -1f && v3.x < 1f)
        {
            //Jumpint
            v3.y += (Mathf.Cos((v3.x+1.0f)/2.0f * 3.1415f))*0.125f;
        }

        if (v3.x > 5.0f)
        {
            hitsLeft = 4;
            v3.x = -10;
            v3.y = 0.5f;
        }
        transform.position = v3;
    }

The sheep not getting hit, will have their position and hit count reset and reused when exiting the screen.

Don't Fall Asheep Progress ScreenShot 003

Don’t Fall Asheep Progress ScreenShot 003

 

– Henning

Don’t Fall Asheep Progress 2013-04-22

Worked on getting some action and game feel to the prototype. So made the buttons for weapon selection (not working buttons) and added sound effects for fire, hit and death. Feels a lot more like a game now.

As the game is going to be have a lot of cartoon violence and blood, I added a blood spray when the projectile (rock) hits the sheep to see if it would work, and I think it does 🙂 Adjusted way to much on the particle systems parameters for a prototype, but it does a lot for the game feel to have some visual feedback on a hit.

Don't Fall Asheep Progress ScreenShot 002

Next couple of tasks will be sheep movement and angle calculations to make the projectiles hit where you aim.

Remember that all the graphics is only placeholders, the final graphics, if the game is fun enough, will be done by someone who knows what they are doing 🙂

– Henning

Don’t Fall Asheep Progress 2013-04-21

Have only had a few fragmented hours to work on Don’t Fall Asheep, and have had a lot of problems with rotations of the build in 2D planes in Unity. But I fixed it by making an empty game object and then making the plane a child of it, then I have full control over the rotation 🙂 But now I find that the collision mesh of the plane is rotated? And I can’t rotate the collider itself, hmm.

After moving the rigidbody, script and mesh collider to child object the collider is oriented as expected.

Progress ScreenShot 001

Basic scene setup with 2D objects, to help get an idea of the space and camera angle

The sheepScript removing the sheep now only removed the child object because of the new placement of the script. But that should only be a matter of destroying the parent game object instead of the current game object.

The screenshot is horrible and it’s suppose to, the focus shouldn’t be on graphics for now, but only on getting a prototype up and running to see if the gameplay is fun.

– Henning