Nearing The End

Kitty now has a full level to run through!

fulllevel

And shiny jewels to collect!

collectjewels

And hazards to avoid!

spikes

Also, the camera has been altered so there’s a space the cat can move in before the camera moves.  Hopefully this will reduce the motion sickness caused when the camera was directly following the cat.

cameralag

I wanted to be able to move the camera up and down so you could see further above and below the cat, but because of time it needs to be left out.

The trigger to change the music and move the camera to the boss field works, but the boss itself still needs to be implemented, along with title and “Thank You For Playing” screens.

Agile and Attacking Kitty

The cat’s movement and animation have been reimplemented, and she can now jump in the air.

airjump

However, there is a bug I noticed back in my Game Design class project where the cat will go into her jump animation when she crosses from one collider to another, as in when she walks along a ground made of tiles each with their own colliders.

floatingcat

One way to get around this is to make one piece of ground one large collider rather than many little ones.

The cat can also stomp the snake enemy off the stage

snakestomp

However, this doesn’t always work.  Sometimes the cat can bounce on a snake indefinitely.

unkillablesnake

Looking at the Inspector, this is because of a bug where the cat sometimes takes off two points instead of one, and because the snake’s HP is never 0 the knockout function is never called.  There may be a way to fix this by preventing the snake from being more than once in a certain time, but an easier solution is to change the code so the snake falls when its HP is equal to or below 0.  I may need to explore the invincibility period solution for enemies with more than one hit point.

The cat can also run, but currently the run option just doubles her speed.  A run animation needs to be added, along with animations to show damage and a knockout state.

ckstates

I experimented with the cat going on all fours when she runs.  For now I figure I’ll keep her upright, if only because it will be quicker to animate.

Next Steps: Add the running, damage, and knockout animations and build a simple level.  Remaining time needs to be invested into developing the boss.

Not A Total Failure

A little while back Lynda.com released a video on building a map tile in Unity, allowing you to paint tiles in a game.  It seemed like it would be a massive time saver to be able to draw out a level with two clicks.

Unfortunately, when I finished coding the tool, it didn’t work.  Instead of overwriting the current tile, it would keep creating new tiles into the same space.  Just tapping the draw key will plop down ten or more identical tiles.

multitiles

I tried loading up the sample file that came with the tutorial, and it worked like it should.  I don’t know if this error is caused by me tweaking the code so the grid is built up and to the right when the tutorial had the grid build down and to the right, but I don’t have time to compare both programs line by line.  And even if I dropped the sample code into my Capstone (which I think counts as plagiarism), the tiles disappear when I save the project and reload it.

So that’s however many hours it took me to set that up down the drain.  At least I was able to reuse the tiles I drew for the experiment, even if I have to tediously lay them out by hand.  And I think I found a solution to a problem that had been plaguing me, where lines appear between the tiles.

I redrew the cat to match the pixel scenery.

pixelck

Using pixels instead of digital painting, at least for now, might be a good way to keep me from getting too obsessed with the visuals and not focusing on the programming, i.e. the IT part.  I can also use “Well, I have to study pixel art!” as an excuse to cram more game time into my schedule.

Currently, the cat can walk and jump around the test area.

bouncybouncy

Next step: Finish character movement, implement enemies that move and attack the cat, and react when stepped on. I’ll work on allowing the cat to scratch enemies later.

False Starts

This week was a collection of frustrations that kept driving me to cool down by working with Python for Kids, from No Starch Press.

To start with, I had to create a rough placeholder cat to program her actions.  First I tried a placeholder cat with the pieces cut up so I could assemble them in Unity.

PlaceholderCK

In old games where space was a premium, it was necessary to cut up sprites and have the game assemble them like a jigsaw puzzle to conserve space.  For example, if an enemy is symmetrical, developers would store only half the enemy in the ROM, then make the game generate two copies and flip one to create the full enemy.  In database terminology, this is normalization.

It seemed unnecessarily time consuming, especially to shave off a megabyte or two.  For now I’m leaving the cat fully formed in a sprite sheets, though it creates some redundancy.  I may work with normalization  later, but right now time is more restricted than storage space.

My next attempt was to scan in some drawings, then roughly draw over them with the pencil tool in Photoshop.

cksheetcrop

In my Game Design I got help from a tutorial that used colliders and rigidbodies to keep the cat on the ground and make her jump.  This time, I want to look into a tutorial video that builds the character controller with raycasts instead of colliders.  I imagine Raycasts are going to be very important (for example, have the enemy cast a ray at the cat to figure out where to fire its projectiles.), so I may as well start learning them now.

The tutorial started with a demonstration of moving platforms which I have in the test level, but right now the cat has no friction on them, and will slide off when they move.

MovingPlatformb.gif