Easy Pathfinding in Corona SDK - Free Lib Does All the Work!
4.5 (3 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
59 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Easy Pathfinding in Corona SDK - Free Lib Does All the Work! to your Wishlist.

Add to Wishlist

Easy Pathfinding in Corona SDK - Free Lib Does All the Work!

Save time; don't start from scratch! Use the free Jumper library to do pathfinding in your Corona SDK game.
4.5 (3 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
59 students enrolled
Created by J. A. Whye
Last updated 10/2013
Current price: $10 Original price: $20 Discount: 50% off
1 day left at this price!
30-Day Money-Back Guarantee
  • 1 hour on-demand video
  • 2 Articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Have a coupon?
What Will I Learn?
Use Jumper to handle A* pathfinding in games.
View Curriculum
  • Free or paid version of the Corona SDK framework.
  • Intermediate level of knowledge with Corona SDK.

There are tons of games where objects need to get from Point A to Point B, all the while avoiding dead ends, cliffs, and who knows what all.

That's where pathfinding comes in.

The Jumper library is available free on Github and this mini-tutorial includes videos with 4 sample demos that will get you up and running fast!

You can pound it out yourself, or get a headstart for less than the price of a movie and snacks!

Note! This is NOT a course for beginners. There is less "hand-holding" in this mini-tutorial than in most of my courses. ;)

Who is the target audience?
  • Corona SDK game developers who need pathfinding in their games.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
Expand All 11 Lectures Collapse All 11 Lectures 01:10:26
Pathfinding with Jumper
3 Lectures 06:37

In the Introduction post I gave you a link to Jumper on GitHub, but for this tutorial I’m going to use the version I just downloaded — that’s so that if something changes, the demo program will still work.

But if you’re going to publish a game using Jumper, it’s probably a good idea to use the latest version. Just do some testing first to make sure it’s working the same as the old version. ;)

Also, there are doc files and other examples in the Jumper-master that you’ll download, so it’s a good idea to grab it. In the demo program we’ll just be using a part of the whole download (the folder called jumper).

Here’s where to grab the whole thing:


If you’re a git pro, clone that — for the rest of us, just use the ZIP button on that page to download the latest copy.

Note! Just received an email from Roland Yonaba, author of Jumper, and he said this:

I always advise people not to grab the latest commit of the librarybecause it might be a cutting edge development version and full of bugs. Instead, just grab the latest release (see https://github.com/Yonaba/Jumper/releases). The link to the latest version is always featured on the README (https://github.com/Yonaba/Jumper#download-latest).
Preview 03:27

Download the sample code from the right, unzip, and pull into Outlaw (if you’re using that IDE – it’s not required).

Here’s a quick video showing how to use the different “main” files in the sample code…

Grab the Sample Code Here
How to use the Jumper Lib
5 Lectures 51:40

There’s a lot of code included with the Jumper library and if you’re into that kind of thing, diving in and exploring is kind of fun. But you don’t have to understand exactly how it works to use it in your games any more than you need to understand an internal combustion engine in order to drive a car.

So while there are a lot of options that can be tweaked with Jumper, what we’re going to cover here are the basics of getting it up and running.

This demo uses the main.lua file from the sample code project.

Basic Usage

Sometimes you can create a walkable map ahead of time, and sometimes you need to build the map at game time. That’s what we’ll do in this video.

The demo code has some cool features you may want to incorporate into your own games, including a drawer that slides from the top of the screen allowing the player to choose objects. In this demo we’re using it as an in-game editor.

This video uses the main-tanksalot.lua file in the project code.

Building a Map on the Fly, Part 1

Building a Map on the Fly, Part 2

What happens if you calculate a path for Monster A to the hero and then the hero moves? The monster should react accordingly and find the best path from where it is now to the new location of the hero (target).

That’s what this demo will do. Bit instead of just using one monster, we spawn five bad guys from random locations every time the hero moves on the screen. And when the hero moves, all the on-screen bad guys adjust their paths and continue heading for him.

I recorded this tutorial video the day Corona Labs announced they nabbed John Romero as a CL Advisor, so I decided the graphics in this demo should be from the game Dangerous Dave, which John programmed in 1991. You can read the Dangerous Dave Saga on his site.

The code for this demo is main-hordes.lua in the project files.

Hordes: Changing Directions

Pathfinding isn’t needed for every game, but if you have a character moving from one place to another on the screen it may come in handy. For example, take a look at this scene from The Secret of Monkey Island:

monkeyislandIf you want Guybrush Threepwood to walk to the fireplace you’re going to want at leastsome pathfinding so he doesn’t walk through the table of pirates.

And yet, that game doesn’t look like it’s built on a grid.

In this demo I’m going to show you how to use the Tiled software to create an invisible map that can be used with Jumper lib for a game like this.

This demo uses the main-gamescreen.lua file from the project code.

Invisible Maps for Games with No Grids
3 Lectures 11:30

In your grid/map you may want to have multiple values to mean walkable. This can often happen when using different tiles to show dirt, stone, wood, etc.

This quick video shows how to create a “walkable” function to be used instead of a variable holding a single value.

Preview 03:04

In the sample code and videos I stuck to the “basics” of Jumper to make sure you could fully grok how to use it in your games.

But it can do so much more. Watch this video to find out about tunneling and clearance, two things that could be vital for your game to have.

Preview 08:18

About the Instructor
J. A. Whye
4.5 Average rating
3,874 Reviews
92,495 Students
7 Courses
Course Instructor

Jay has been programming professionally since 1988, starting with game programming and then over the years moving to internet programming with a major Seattle telecommunications firm. Jay started programming for mobile devices in 2010 and currently has several games and apps in the Apple App Store with more on the way.

In addition to writing hundreds of technical articles over the years, Jay has recorded dozens of hours of tutorial videos. He's been a speaker at technical conferences and enjoys teaching how to make games and apps almost as much as making games and apps themselves.

Jay is a Certified Developer with Corona SDK, and is also diving into Unity to make 2D games and tutorials.