Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1395381 Posts in 67256 Topics- by 60331 Members - Latest Member: Alexson

September 22, 2021, 03:23:21 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsKat-Fu (My girlfriend wanted a cat game)
Pages: [1] 2
Print
Author Topic: Kat-Fu (My girlfriend wanted a cat game)  (Read 3584 times)
Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« on: November 28, 2015, 03:51:27 PM »

 Hand Metal Left Tiger Hand Metal Right

Code for this game is available on Github: https://github.com/alexpennells/kat-fu



Latest Update





Gonna start updating the first post here to prevent having to scroll through to see the latest update. This is just a standard content update. More areas/enemies have joined into the mix. I decided to make some of the starter enemies just simple things you see around a house, like empty cans. When you're a kitten, you can trust no household object :3



Original Post

I've spent the last year (on and off) developing an engine for a somewhat ambitious 2.5D platformer I'm making. Thing is I've been working on it for so long I need a break from it, so when my girlfriend said I should make a game about a cat, I was like why the F not?

So I broke down my engine (I call it the Stitchin' engine) so I could use it across multiple Unity projects and started building a new 2D game using it called Kat-Fu. The concept behind this game is to make the dopest Metroidvania that I can in a short dev cycle, using my existing engine.

I always slow myself down cuz I'm a perfectionist when it comes to the game art, problem is I'm not a graphics guy. So one thing I'm going to focus on when building this game is avoiding touching any graphics and focus more on the level design and gameplay. If the game ends up looking like sh*t, whatever. I'll be doing a minimalistic design to simplify things though, most graphics will likely be taken from http://opengameart.org/

Hand Point Right Technologies used Hand Point Left
Unity
I've built my own 2.5D physics engine in Unity that I call Stitchin', and Kat-Fu is built on top of that. All coding is done in Unity and is available at https://github.com/alexpennells/kat-fu if your curious. The parts relating to Stitchin you won't be able to see though, as they're stored in my own private repo.

Ferr2D Terrain Tool
Stitchin' engine uses smooth slopes based on trig functions, so I needed something that would let me create smooth slopes easily. Ferr2D fits the bill http://www.ferrlib.com/page/Ferr2D_Terrain_Tool

Github
I host my code on Github so I don't have everything stored locally. The source code for Kat-Fu can be found there, minus the Stitchin' engine itself. If you have any questions about the structure or anything, feel free to ask


Hand Point Right Art Hand Point Left
I always slow myself down trying to find the perfect art cuz I have no idea how to make it myself. I'm going to avoid that and just constantly make the game without worrying about it. The current plan is to build the game using this as the main character http://opengameart.org/content/cat-fighter-sprite-sheet, and then just wing it from there

Hand Point Right Screenshots Hand Point Left




« Last Edit: September 29, 2017, 12:20:45 PM by Dank3yKang » Logged

jamesprimate
Level 10
*****


wave emoji


View Profile WWW
« Reply #1 on: November 28, 2015, 04:53:40 PM »

looks cool already! i like the art style and the physics combined with the smooth slopes gives it a different vibe than the usual pixel platformer whatever.  Hand Thumbs Up Right Hand Thumbs Up Right
Logged

Jalapenosbud
Level 1
*


View Profile
« Reply #2 on: November 28, 2015, 05:57:46 PM »

Looks interesting Smiley
Btw i looked through the github for the game, do you use a custom sprite animator for unity? or what is the SpriteObj you inherit from, i can't seem to find it in the repo.
Reason im asking is cause i have some problem with the animations playing properly, and im unsure whetever to roll my own animator stuff Tongue
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #3 on: November 28, 2015, 07:53:45 PM »

So yeah, the SpriteObj class is part of the Stitchin' engine which isn't in the repo. It's mostly just a wrapper for some of the weirdness that Unity throws me when I'm trying to work with sprites. There's a good chance I bumped into some of the same issues that you did.

It's a small file though, so I don't mind sharing the whole thing here:

Quote
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Specialized;

[RequireComponent (typeof (SpriteRenderer))]
[RequireComponent (typeof (Animator))]
public class SpriteObj : BaseComponent
{
  // Whether or not the object should face left to start.
  public bool mirrorToStart = false;

  protected SpriteRenderer spriteRenderer;
  protected Animator animator;

  private string currentlyPlaying;

  public override void LoadReferences() {
    spriteRenderer = Base.GetComponent<SpriteRenderer>();
    animator = Base.GetComponent<Animator>();
  }

  public override void Init() {
    if (mirrorToStart)
      transform.localScale = new Vector3(-1, 1, 1);
  }

  public void Play(string animation) {
    currentlyPlaying = animation;
    animator.Play(animation);
  }

  public void Play(string animation, float speed) {
    Play(animation);
    SetSpeed(speed);
  }

  public bool IsPlaying(string animation) {
    return currentlyPlaying == animation;
  }
  public bool IsPlaying(string a1, string a2) { return IsPlaying(a1)||IsPlaying(a2); }
  public bool IsPlaying(string a1, string a2, string a3) { return IsPlaying(a1)||IsPlaying(a2)||IsPlaying(a3); }
  public bool IsPlaying(string a1, string a2, string a3, string a4) { return IsPlaying(a1)||IsPlaying(a2)||IsPlaying(a3)||IsPlaying(a4); }

  public void SetSpeed(float speed) {
    animator.speed = speed;
  }

  public float GetAlpha() {
    return spriteRenderer.color.a;
  }

  public void SetAlpha(float alpha) {
    spriteRenderer.color = new Color(1f, 1f, 1f, alpha);
  }
}

Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #4 on: November 28, 2015, 08:01:46 PM »

looks cool already! i like the art style and the physics combined with the smooth slopes gives it a different vibe than the usual pixel platformer whatever.  Hand Thumbs Up Right Hand Thumbs Up Right

 Epileptic <-- Me after I finished rebuilding my engine with smooth slopes... it'll be nice to get back to building levels finally
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #5 on: December 01, 2015, 06:57:29 PM »

Added another enemy. Just a simple flying + spit thing at player enemy. Made sure it worked nice and smooth within the given bounds





 Hand Metal Left Tiger Hand Metal Right
Logged

Jalapenosbud
Level 1
*


View Profile
« Reply #6 on: December 01, 2015, 10:38:31 PM »

So yeah, the SpriteObj class is part of the Stitchin' engine which isn't in the repo. It's mostly just a wrapper for some of the weirdness that Unity throws me when I'm trying to work with sprites. There's a good chance I bumped into some of the same issues that you did.

It's a small file though, so I don't mind sharing the whole thing here:

Quote
code


hmm but are you still using the animator component from unity or? Smiley

and btw that flying enemy looks nice, i like the bounds thingy that goes up n down and in n out
how would one go about coding that? Tongue
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #7 on: December 02, 2015, 01:02:56 PM »

Quote
hmm but are you still using the animator component from unity or? Smiley

Yeah, Sprite.spriteRenderer and Sprite.animator are the Unity components that get loaded when the Scene starts. The SpriteObj class just simplifies some of the calls to those Unity components

Quote
and btw that flying enemy looks nice, i like the bounds thingy that goes up n down and in n out
how would one go about coding that? Tongue

You can just use DrawGizmos on a MonoBehaviour object. Here's a snippet from Bat_Base.cs
Code:
  // Max position this bat can move in either direction.
  public Vector2 max = new Vector2(0, 0);
  public Vector2 min = new Vector2(0, 0);
  public Vector2 accel = new Vector2(0, 0);

  protected override void Init () {
    // Max and min should be based on local position.
    max = new Vector2(x + max.x, Mask.Center.y + max.y);
    min = new Vector2(x + min.x, Mask.Center.y + min.y);
  }


  // Draw the movement area
  protected override void DrawGizmos () {
    Vector2 drawMax, drawMin;

    if (!Application.isPlaying) {
      drawMax = new Vector2(x + max.x, Mask.Center.y + max.y);
      drawMin = new Vector2(x + min.x, Mask.Center.y + min.y);
    }
    else {
      drawMax = max;
      drawMin = min;
    }

    Debug.DrawLine(new Vector3(drawMin.x, Mask.Center.y - 10, 0), new Vector3(drawMin.x, Mask.Center.y + 10, 0), Color.magenta, 0, false);
    Debug.DrawLine(new Vector3(drawMax.x, Mask.Center.y - 10, 0), new Vector3(drawMax.x, Mask.Center.y + 10, 0), Color.magenta, 0, false);

    Debug.DrawLine(new Vector3(x - 10, drawMin.y, 0), new Vector3(x + 10, drawMin.y, 0), Color.magenta, 0, false);
    Debug.DrawLine(new Vector3(x - 10, drawMax.y, 0), new Vector3(x + 10, drawMax.y, 0), Color.magenta, 0, false);
  }

- Mask.Center.y is the vertical center of the Bat (I use bottom-center for the origin of my objects)
- You can see in the OnDrawGizmos function how I draw the lines based on the position of the Bat
- Notice how Init() changes the values of max/min based on the position of the Bat. That's so I can set "max = Vector2(-10, 10)" in the Unity Inspector, and it'll set the max and min values based on where the Bat is in the Scene

Check out https://github.com/alexpennells/kat-fu/tree/master/Assets/Scripts/Bat if you want to see it all
Logged

Jalapenosbud
Level 1
*


View Profile
« Reply #8 on: December 02, 2015, 03:07:43 PM »

Quote
Yeah, Sprite.spriteRenderer and Sprite.animator are the Unity components that get loaded when the Scene starts. The SpriteObj class just simplifies some of the calls to those Unity components

Ah okay cool. Well the problems im having, is that the animator plays the animations kinda weird, compared to how the keypress is. So i guess its just a matter of adjusting the "timing" in the animator, so it fits perfectly, i was looking for a way to do it code-wise Smiley

Quote
You can just use DrawGizmos on a MonoBehaviour object. Here's a snippet from Bat_Base.cs

Awesome! it's cool that you wanna share it and that you keep it open-source Smiley thanks Smiley
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #9 on: December 02, 2015, 06:41:43 PM »

Ah okay cool. Well the problems im having, is that the animator plays the animations kinda weird, compared to how the keypress is. So i guess its just a matter of adjusting the "timing" in the animator, so it fits perfectly, i was looking for a way to do it code-wise Smiley

Yeah, I'm not a huge fan of the way Unity animates sprites. It doesn't feel very precise which is kinda important for pixel platformers, they animate them similar to the way that they do 3d animations.

My IsPlaying() function used to look like..

Code:
  public bool IsPlaying(string animation) {
    return animator.GetCurrentAnimatorStateInfo(0).IsName(animation);
  }

...I noticed that when I ran..

Code:
  sprite.Play("walk_anim");
  sprite.IsPlaying("walk_anim");

IsPlaying() would return false. It was reeeeally pissing me off, so instead I started keeping track of the current sprite in my own string instead. Little things like that were the reason I made the SpriteObj wrapper class, since I know there's definitely going to be more as I keep going

Quote
Awesome! it's cool that you wanna share it and that you keep it open-source Smiley thanks Smiley

Yeah for sure, I don't mind sharing some of my work  Gentleman
Logged

apargames
Level 0
**



View Profile WWW
« Reply #10 on: December 03, 2015, 03:28:10 AM »

this game seems so fun to play just by looking at it will be following this , love the concept(credits to ur girlfriend)
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #11 on: December 03, 2015, 01:20:49 PM »

this game seems so fun to play just by looking at it will be following this , love the concept(credits to ur girlfriend)

Trying to keep it simple fun as I don't want development to take too long  Wink
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #12 on: December 03, 2015, 01:27:16 PM »

Added a Weed enemy. So far it spits the same projectiles as the Bat, but he's a bit harder to kill. He'll start biting at you when you get close range and he'll jump at you if you try to jump over him. But he's vulnerable when he jumps and he's always open to ground pounds





 Hand Metal Left Tiger Hand Metal Right
Logged

Wilson Saunders
Level 5
*****


Nobody suspects the hamster


View Profile WWW
« Reply #13 on: December 03, 2015, 02:21:24 PM »

so when my girlfriend said I should make a game about a cat, I was like why the F not?

By far the best reason to make a game. Especially when you stay up until 3 am trying to fix that one bug, your girl will have no one to blame but herself.

I mean it looks good keep it up.   Coffee
Logged

Play my games at http://monkeydev.com/
Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #14 on: December 06, 2015, 02:23:43 PM »

By far the best reason to make a game. Especially when you stay up until 3 am trying to fix that one bug, your girl will have no one to blame but herself.
I mean it looks good keep it up.   Coffee

Lol, I wish. I'll probably still get blamed  Facepalm


Adding an additional stance to the current fighter stance. There's no bullets yet, but the motion is complete.
While you move slightly slower, it's the only ranged attack in your arsenal. It also takes a short second to switch between the gun and Kat-fu stance.



 Hand Metal Left Tiger Hand Metal Right
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #15 on: December 07, 2015, 08:00:43 PM »

Bullets added as well as collisions with the existing enemies.

I'm done most of the basic control at this point. I have one more enemy that I plan to make, but then I'll start putting some time into building the actual world that you can explore (aka the fun part)





My plan at this point is to have the game take place in a house where you move through the walls and the rooms as you progress, in true Metroidvania style.

 Hand Metal Left Tiger Hand Metal Right
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #16 on: December 13, 2015, 06:49:48 PM »

Been a slow week for me but I've been playing around with the Unity 2d lighting effects.

I put together a small little level that you can see more of here:


It's not really the type of level you'd expect to see in the final game, it's just for preview reasons

Here's a couple snippets:





 Hand Metal Left Tiger Hand Metal Right
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #17 on: February 09, 2016, 08:42:55 PM »

Been about a month hiatus, so I guess I should update...

Starting to play around with how I want the levels to look. This is always a slow and boring process for me as I want it to look perfect and (due to my lack of art skillz) I am very unable to do so. Just got to remind myself to keep trooping through it anyways

So building the intro room, aka the Laundry Room. As this is a Metroidvania about a cat, the area of exploration will be... a house. Making the house all house-y is what's eating my time. Luckily, when the cat enters the walls I can make it more of an imaginary world and do w/e the hell I want.

For now, all art is temporary. Most of it was stolen as filler from Scribblenauts and looks horrible in engine. The weird looking blobs on the ground will eventually become piles of clothes (at least that's the concept). The shelves on the wall will also hopefully be unshitty-fied in the future too





Took a bunch of time refining some of the control too. Not quite done yet (never done really -_-), but it's actually much slower now then it used to be

 Hand Metal Left Tiger Hand Metal Right
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #18 on: April 03, 2016, 05:39:45 AM »

Progress has been slow over the last couple months, but I've been doing some polishing on the engine. Worked out a lot of kinks, and it's running smoother than ever. Too many changes have gone into this revision to list, but a couple more major things:

- Music persists between rooms
- Added room transitions
- Updated the cat's punching combo (More smooth and fluid now)
- Slowed the overall game pace (Dumbing down a bit, was too fast before)
- Started making the intro area





Sorry for the long delay, I'm going to be posting more regular updates for this again. Was just going through a mostly refactoring stage

 Hand Metal Left Tiger Hand Metal Right
Logged

Dank3yKang
Level 0
**


I make games n shiet


View Profile WWW
« Reply #19 on: April 10, 2016, 10:35:32 AM »

This update is mostly engine related this time. I added sloped roofs to the Stitchin' engine which I had been meaning to do for a while now. While I was at it I also cleaned up a couple other glitches (while introducing new ones -_-)

New video that shows off how the solid objects are put together in my Physics engine.
Red lines = Solid platforms
Blue lines = Object masks





Anything you want to know about the engine, feel free to ask

 Hand Metal Left Tiger Hand Metal Right
Logged

Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic