Dank3yKang
|
|
« on: November 28, 2015, 03:51:27 PM » |
|
Code for this game is available on Github: https://github.com/alexpennells/kat-fu Latest UpdateGonna 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 PostI'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/ Technologies used UnityI'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 ToolStitchin' 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_ToolGithubI 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 Art 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 Screenshots
|
|
« Last Edit: September 29, 2017, 12:20:45 PM by Dank3yKang »
|
Logged
|
|
|
|
|
Jalapenosbud
Level 1
|
|
« Reply #2 on: November 28, 2015, 05:57:46 PM » |
|
Looks interesting 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
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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: 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
|
|
« Reply #5 on: December 01, 2015, 06:57:29 PM » |
|
|
|
|
Logged
|
|
|
|
Jalapenosbud
Level 1
|
|
« 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: code
hmm but are you still using the animator component from unity or? 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?
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« Reply #7 on: December 02, 2015, 01:02:56 PM » |
|
hmm but are you still using the animator component from unity or? 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 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? You can just use DrawGizmos on a MonoBehaviour object. Here's a snippet from Bat_Base.cs // 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
|
|
« Reply #8 on: December 02, 2015, 03:07:43 PM » |
|
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 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 thanks
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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 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.. public bool IsPlaying(string animation) { return animator.GetCurrentAnimatorStateInfo(0).IsName(animation); }
...I noticed that when I ran.. 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 Awesome! it's cool that you wanna share it and that you keep it open-source thanks Yeah for sure, I don't mind sharing some of my work
|
|
|
Logged
|
|
|
|
apargames
|
|
« 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
|
|
« 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
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« Reply #12 on: December 03, 2015, 01:27:16 PM » |
|
|
|
|
Logged
|
|
|
|
Wilson Saunders
|
|
« 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.
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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. Lol, I wish. I'll probably still get blamed 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.
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« Reply #15 on: December 07, 2015, 08:00:43 PM » |
|
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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:
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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
|
|
|
Logged
|
|
|
|
Dank3yKang
|
|
« 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
|
|
|
Logged
|
|
|
|
|