Sidescrolling Platformer – Part 13 – Enemy Interactivity

As I announced in the last post, I am extremely busy right now. Luckily for you, a member of the community has already stepped up and written a Part 13 for this side scrolling tutorial! In this tutorial, you’ll learn to create “bumper” objects for your enemies to interact with, which will let them patrol back and forth. You’ll also look for collisions between the player and the enemies, so you can take damage in your game. Cool!

I’ll hand it over now to the newest guest writer around here, Ed Nordmeyer (thanks, Ed!)

Ben covered creating enemies and making them disappear when they’re shot in lesson 12, so in lucky lesson 13, in this guest tutorial, I’ve picked up where the last lesson left off in the side scrolling platform game.

This will cover making the enemies move, how to block them in so they’ll patrol in a simple side-to-side motion, and have them interact with your player if they touch you. Following in Ben’s footsteps, if I had to choose between making the code readable or making the code ultra efficient and take up the least amount of lines, I tried to make the code as easy as possible to understand.

Creating the Bumper class

If you’ve followed the tutorial steps so far, you’ll find that creating the bumper class is very, very similar to the other classes made so far. For the artwork, I just made a square that was about a 25×25 pixels in size. I created this block on the background layer outside of what the player screen shows when you’re running the game. We’ll go back and made the blocks transparent later, but for now I’d recommend making them easy to see to help placing them on the screen from our code.

Continue reading

My Story — Our Site

Hi everyone. Thanks for sticking with the site and forum, despite my lack of activity.

I think you deserve a bit of an explanation about my recent disappearance.

I started programming when I was 13, using MIT’s revolutionary software, Scratch. Five years later, thanks to an amazing online community of teachers and tutorials, I’ve worked on many Flash games, I’m a professional iPhone/iPad app developer, and I’m currently sitting in an MIT dorm, getting ready for my freshman year to begin! It’s been quite the ride of teaching and learning to program over these 5 years!

Needless to say, the transition to college is a big one, and my free time has dwindled. I expect my workload to be intense, and therefore I can’t commit to being very present on the site and forum in the near future.

I wish I could say this is the end of my hiatus, but I can assure you that I haven’t abandoned AS3GameTuts.

I’ll try to check in every once in a while, and keep the site up-to-date. If you want to contribute to the site in any way during my absence, feel free to reply here, send me an email at as3gametuts@gmail.com, or send me a message on the forum. Perhaps you’d like to write a guest-post tutorial, or you’ve assembled a group of links, tips, news, etc that would be helpful to post on the site. Honestly, I’m not making any money off of the site (I’m actually losing a few dollars per year for the domain name). The site is my way to “pay it forward” to a community that has given so much to me. If you’d like to contribute to this effort as well, let me know (don’t worry, I’ll give you credit/rights/etc to any content you contribute).

And hopefully after a little while I’ll settle into a good rhythm and perhaps have the time to start writing full-length tutorials again!

Cheers,
Ben