Left/Right Movement with Sprite Flipping in a Unity 2D Platform Game (with JavaScript and C#)

Left/Right Movement with Sprite Flipping in a Unity 2D Platform Game (with JavaScript and C#)

This is part 3 of a series of tutorials for Buiding a 2D Platform Game in Unity.

A character which can jump and double-jump is great, but we need a little more action. In this tutorial, our actor is going to be able to also move left and right. This tutorial shows how to use GetKey to handle the left and right arrow keys for movement. Then we add a function to flip the sprite horizontally, so it appears to face in the expected direction.

This tutorial is presented in two videos: one video each for JavaScript and C# (C-Sharp). I’ve presented both languages, since it’s sometimes not clear how to convert code from the other language when watching a tutorial. The code performs the same functions and produces the same game play, so you only need to watch one.

In this video we…

  • use the JavaScript or C-Sharp (C#) language
  • add left/right movement with arrow keys
  • use GetKey
  • use GetComponent(RigidBody2D)
  • use Vector3
  • add a function to handle sprite flipping, horizontally

JavaScript (Unity Script) version

C# (C-Sharp) version

This tutorial builds on the first project and the GitHub tag for this tutorial is v2

In the next video, I will show how to follow the actor with the camera, and detect death falls.

Be sure to subscribe to the Playlist to get the future updates: Unity 5 2D Platform Game Development (Mac) Playlist

Jumping and Double Jumping in a Unity 2D Platform Game (with JavaScript and C#)

Jumping and Double Jumping in a Unity 2D Platform Game (with JavaScript and C#)

This is part 2 of a series of tutorials for Buiding a 2D Platform Game in Unity.

An essential part of a platform game is the ability to jump. Sometimes you need to jump over barrels, onto mushroom people, or just jump up to the next platform.

Space Panic, released in November 1980, is probably the first platform game, but Donkey Kong introduced the jump mechanic in 1981.

This tutorial is presented in two videos: one video each for JavaScript and C# (C-Sharp). I’ve presented both languages, since it’s sometimes not clear how to convert code from the other language when watching a tutorial. The code performs the same functions and produces the same game play, so you only need to watch one.

In this video we…

  • use the JavaScript or C-Sharp (C#) language
  • add a script component to our actor
  • add jumping with space bar key
  • tag objects as “Ground”
  • use GetKeyDown
  • use GetComponent(RigidBody2D)
  • use Vector2
  • use OnCollisionEnter2D
  • add double jumping
  • refactor code into a function

 

JavaScript (Unity Script) version

C# (C-Sharp) version

 

This tutorial builds on the first project and the GitHub tag for this tutorial is v2

In the next video, I will be showing how to add left/right movement.

Be sure to subscribe to the Playlist to get the future updates: Unity 5 2D Platform Game Development (Mac) Playlist

How to setup a Unity 5 project and add Kenney’s “Platformer Tiles”

This is the first video in my Unity 5 2D Platform Game Development Tutorial series.

Many of the existing 2D Platformer tutorial videos are outdated with Unity 5, and the C# (c-sharp) and UnityScript (JavaScript) files need to be updated. Also, many of the tutorials are for either C# or UnityScript, but not both. You may like C#, but the tutorial you need may be in UnityScript. Or vice, versa.

I will run through building a 2D Platformer in Unity 5 and I’ll be showing how to do the steps in both scripting languages (both C# and UnityScript/JavaScript).

Unity 5 2D Platform Game Development (Mac), Part 01 Sprites Collision RigidBody2D

In this first video, I introduce Unity 5 and show how we are going to set up the project for the future steps. We also download an import public domain art assets from Kenney, using OpenGameArt.org.

Some of the highlights:

In this video, we …

  • download Unity
  • create a new project with Scenes and Sprites folders
  • save the first Scene
  • import Kenney’s art
  • create a player actor
  • create a ground block
  • add collision components
  • add gravity
  • preview the game
Here is the video:

This tutorial starts with a fresh project, but the completed GitHub tag for this tutorial is v1.2 (See this link about the 2 Platformer GitHub source and tags)

In the next video, I will be showing how to get keyboard input working to control jumping and left/right movement.

Be sure to subscribe to the Playlist to get the future updates: Unity 5 2D Platform Game Development (Mac) Playlist

Bulldogs! Fate based Sci-Fi character sheet for 5×8 cards

I made a sheet for the FATE based Bulldogs! RPG characters as a PDF, printable on a 5×8 index card.

I’ve been playing around with “Bulldogs! Sci-Fi That Kicks Ass” RPG, which uses the FATE system.

I have a thing for small character sheets, like 5×8 index card size. So, I made a sheet for Bulldogs! characters into a PDF. It should be printable on a 5×8 index card. I used the ones that are lined on one side, and I print on the blank side, so I can add notes to the lined side as needed.

Bulldogs! FATE Character Sheet 5x8BULLDOGS!5x8CharacterSheet2 (PDF)

More information about Bulldogs! Sci-fi that Kicks Ass (RPG Geek).

Microlite20 Character Sheet for 5×8 Index Cards

Recently, I shared the file and a link to a Lulu formatted version of the Microlite20 rules which we use for our role playing game.

Here is the character sheet we use for our Microlite20 characters. It prints well on the plain side of a 5×8 index card. The lined side can then be used for notes, or – if you use the “plain on both sides” kind – character profile drawings.

Continue reading “Microlite20 Character Sheet for 5×8 Index Cards”