• Unlikely Objects
  • Ludography
    • Nonoku
    • Acquisition
    • Image Mark Up
  • About
Menu

Unlikely Objects

  • Unlikely Objects
  • Ludography
  • Pint Sized Planet
    • Nonoku
    • Acquisition
    • Image Mark Up
  • About

An Evening of Code: Depth Sorting

January 29, 2015

Whew... This one took way longer than expected. I'm using the 2D Toolkit Unity plugin to handle the tile map with a Unity 2D Sprite for the player character. Arguably overkill for what I need at the moment but I already had the plugin and it let me get up and running really quickly. Whilst it wasn't supported out of the gate I figured that it wouldn't been too difficult to add. Get the z-coords of the current tile and stand the player on it. Done.

Nope, fortunately this had already come up in the forums. That put me on the right track (Transparent Cutout shader on the Sprite - I started writing my own but spotted the Unity Unlit/Transparent Cutout shader before I got too far and it seems to work fine). Modifying the code shown in the forum post and then reviewing the updated scene whilst the game was  running showed me how the offsets worked for both tiles and chunks. After some tweakery it was close but not quite right. Eventually, I realised that each chunk was offset by 0.0001 on the z-axis. Just removing that value fixed the problem without causing any issues (I could have accounted for it and if I see a problem in the future I might). 

In An Evening of Code, Unity Tags unity, gamedev, indiedev, isometric
← An Evening of Code: Animated DefenceAn Evening of Code: Pathfinding →

Latest

Unlikely Objects
Fractal Plant in Godot
about a year ago
Binary Tree in Godot
about a year ago
Sierpinski Triangle in Godot
about a year ago
Re-visiting some old code
about a year ago
React - Starting a New Project
about 3 years ago
Satsuma Tosser
about 4 years ago
1HGJ #002: Deeper and Deeper
about 7 years ago
1HGJ #001: Telekinetic Bomberman Rush
about 7 years ago
Migrating to NSPersistentContainer
about 7 years ago
Nonoku - SpriteKit Shader
about 7 years ago

Powered by Squarespace