Hi Again! So in this tutorial we will be implementing towers with splash damage, per-tower upgrades, and creep army upgrades, but before we begin that it’s time to get us ready for these upgrades.
Open the source code and find the files baseAttributes.h and .m. add these files to your project class folder, open them and take a look inside.
Ok, so there are a few variables in here which may be new or unexpected, however if they are not immediately obvious we will be using all these variables in the near future. The main categories of variables are, base health and money variables, Machine Gun variables, Freeze tower variables, Cannon tower variables and Creep variables.
As always – Source code AND download after the break
Continue reading ‘How to Build a Tower Defense Game for the iPhone – Part 8B – Tower Powers’
By
iPhone Game Tutor | Published on
February 12, 2012 in
Advanced, Cocos2d and Tower Defense.
Tags: actionWithTarget, addChild, addObject, CCLabel, CCSprite, CGRectContainsPoint, CGRectMake, Download, iphone, source, source code, tower defense, tower defense game, tutorial, Tutorials.
Ok, so a few issues have been raised over the course of this tutorial series and I have tried to answer them as we go in the comments section. However I feel that we could do with a good clean up of our code. In this tutorial we will be doing a little spring cleaning of the code and preparing for future improvements such as, Splash damage tower, Upgrading towers (real time), Upgrading/Personalizing army stats (between rounds).
Firstly, problem solving:
After downloading the source code, the first thing that anyone with a developers license should see is that when you run the game those pesky lines / tile artifact issues have been solved. This was done by a small edit to the file CCSprite.m, big thank you to DreemLife for your efforts with sorting out this issue. If you are experiencing those tile artifacts in this project, the previous tutorials, or for any other project, then replace your CCsprite.m file with the one from the source code in this project.
Tower shenanigans:
Sometimes after a Creep has been removed, a Tower will send a projectile towards (0,0). This is because we have removed the towers target, without telling it not to shoot. Simply add the following to tower.m -> FinishedFiring method. (This will need to be done for all Tower classes)
Continue reading ‘How to Build a Tower Defense Game for the iPhone – Part 8 – Some early spring cleaning’
Hello, and welcome to part 7 of the Tower Defense Tutorial Series. – Money and Health!
In this tutorial we will incorporate “money” into the game so that towers cost the player, and the amount of money available will slowly increase over time. We shall also be incorporating base health bar into the game so we can ultimately have a game over. This particular tutorial focuses primarily on implementing dynamic labels and images, and the game logic behind them, as part of the gameHUD.
When adding labels to gameHUD.m the first thing we need to do is to decide upon what we want to display, in this case; Money count, abase health label and a base health bar, a wave count, and the prices of each tower.
Source code after the break…
Continue reading ‘How to Build a Tower Defense Game for the iPhone – Part 7 – Money and Health’
By
Aiden Fry | Published on
January 18, 2012 in
Advanced, Cocos2d and Tower Defense.
Tags: cocos2d, Download, freeze towers, ice projectiles, programming, source code, tower defense, tower defense game, tower powers, tutorial.
Welcome back to the Tower Defense Tutorial Series! Once again I am assuming that you have read the previous 5 parts of this tutorial and are happy with the content covered in them.
In this Tutorial, we will be incorporating a new tower type into our game, this will give you the knowledge to then continue on and make/implement your own towers types. The tower type which we will be incorporating is a freeze tower, this tower will shoot Ice projectiles at a creep which will freeze it in place for a period of time, before the creep then continues on its journey.
Source code after the break!
Continue reading ‘How To Build a Tower Defense Game for the iPhone – Part 6 – Tower Powers’
[Editor's Note: One of our readers spoke up and decided to help us finish off this series of tutorials. Many thanks to Aiden Fry for stepping up to the plate!]
Welcome to the latest edition of the Tower Defense Tutorial. This is just the start of the long awaited renewal of the Tower Defense Tutorials. I (like many of you I am sure), have been following this particular tutorial series with interest, and was slightly downcast when I realized that part 4 was the last to be released. So hear me now, I vow to take up the challenge and by the end of these tutorials we will have a fully working game!
Yours, Aiden.
[Editor's Note: We are also very happy that Aiden has taken up the challenge as well!]
The Tower Defense Tutorial Part 5a – Multiple Waves!
A Quick Look Back:
I will assume that all of you have been following the tutorial series found here – part 1, part 2, part 3, part 4 – and are mostly OK with what has gone before, however it is good just to mention a few key things about what has already taken place.
- We have some creeps that go around a set path.
- We can place towers around the path.
- Towers fire at the nearest Creep.
- Creeps have Hp, and when HP is 0 (due to tower projectiles) the creeps “die” and are removed from the game.
- At the moment there is only one “Wave” of Creeps.
Aims of this Tutorial:
- Creating Multiple waves of Creeps.
- Defining how many Creeps of each type (red/green) per wave.
Source code after the break…
Continue reading ‘How To Build a Tower Defense Game for the iPhone – Part 5a – Multiple Waves’
By
iPhone Game Tutor | Published on
July 6, 2011 in
Programming, Tutorials and iPhone.
Tags: business tutorials, game, game programming tutorials, graphic tutorials, iphone, mobile business, programming, tutorial, Tutorials.
and… get your game or product some exposure as well? We have hit over 10k uniques this month of people looking for quality game tutorials for the iphone. Unfortunately, for those who have been keeping score… We’re finding it hard to maintain a company and post regular tutorials at the same time
This is where you come in…
You start by contacting us at info ( a t ) iphonegametutorials ( d o t ) com… Then you build off an existing tutorial on the site or maybe come up with a new tutorial all your own! You get full credit for that tutorial and it will be displayed on iphonegametutorials.com for all to see. We plan on including a side bar of “Contributors” as well, so you’ll get tremendous exposure there as well. I don’t know what could be better for someone trying to show off their chops in the mobile game space or get a little more spotlight on the game they’ve made!
Continue reading ‘Want to Help iPhone Game Tutorials?’
By
iPhone Game Tutor | Published on
June 29, 2011 in
Cocos2d, Intermediate, RPG and Tutorials.
Tags: class, cocos2d, Development, Download, framework, game, iphone, map, mapeditor, programming, source, source code, tile, tiles, tutorial, Tutorials, update.
Update: Made some modifications to the source code – changed the title music (Hope you enjoy a remix of Dragon Warrior) and expanded the map to give a better idea of how you can use the space. Also, I added grid lines to the tiles so it didn’t looks so much like a painting. More parts to come!
It’s been a while since part 1 – we know from your comments that it’s not your favorite thing in the world (it’s not ours either) but we’re gonna try to get going again!
That being said, if you haven’t read part 1 of the tutorial, or the intro describing what we’re working towards, now’s your chance to play catch-up before plunging forward into the next piece of unknown – tile based maps using Tiled!
As will be the case for the rest of the tutorial, we’re using the Cocos2D framework for game development, which already includes support for the TMX file format (we’ll get to that later – just know that it makes our lives easier!). To build the map, we’re going to be using Tiled Qt, a fantastic piece of software that makes creating maps a piece of cake!
Source code after the break!
Continue reading ‘RPG Style Game for the iPhone – Part 2: Tiled Maps’
By
iPhone Game Tutor | Published on
June 8, 2011 in
Cocos2d, Intermediate and Tutorials.
Tags: cocos2d, in-app, itunes connect, money, payments, purchase, ray wenderlich, test user, tutorial.

*** NOTE: The in-app purchase items that are included in the sample code will only work if you are accessing the US app store. If you are outside of the US, you will have to create your own application and in-app purchase items, and overwrite the ID’s that we specify in the code. Thanks to reader Ben Rad for pointing out that it also will not work with jailbroken iOS devices! ***
Hey everyone – we’re in the midst of a project where we’ve just had to implement In-App purchases, so we figured we would get this quick little tidbit of info out to you all. What we’ve put together is a quick sample app based off of Ray Wenderlich’s tutorial. Ray’s tutorial was based off of UIViews, and we here at iPhone Game Tutorials love Cocos2d (download here!) so we ported this over. Hopefully this helps someone make some big bucks!
Source after the break!
Continue reading ‘Cocos2d Tutorial – Using In-App Purchases’
As I’m sure you’ve noticed we’re taking our sweet time getting the next tutorial out – Our apologies to everyone. We’ve been under a pretty intense sprint (even for game companies) and we’ve been pushing out a trivia engine to the iphone most of the last week and now into this week (memorial day weekend didn’t help things).
Anyway, just wanted to give an update, don’t think this site isn’t on our mind and we hope to have the tutorials rolled out soon!
Recent Comments