Pirate Adventure

A tile-based adventure game utilizing arrays and objects leading to an eventual boss fight

About

This app served as my first in-depth project in Objective-C for iOS development. The goal for the user was to go through the challenges, similar to a board game, and make the correct choices which eventually led up to the eventual fight with the boss.

Methodology

In order to create the board, which was essentially a grid, I created an array of 4 columns. Each object in the array served as a pointer to another array which contained 3 objects in it, each object being a tile. For each tile, there was a variable assigned to key UIView elements, such as character.health and character.weapon.

To keep track of the current position of the character I first set the current point by calling function CGPointMake(0,0) and would then update the point after the user pressed a navigational button. For example, when pressing the north button, the program called the function northButtonPressed which looked like this:

- (IBAction)northButtonPressed:(UIButton *)sender
{
	self.currentPoint = CGPointMake(self.currentPoint.x, self.currentPoint.y + 1);
	[self updateButtons];
	[self updateTile];
}

In order to ensure that the UIView was showing the correct information, I created a function updateTile which would call other functions to update all pertinent informtion, ranging from each label to enabling/disabling buttons.

Lessons Learned

In this project I spent much of my time to make my code easily parameterized. Instead of hard coding each tile, I created a RDTile class, and a RDTileFactory class to dynamically create a number of tiles which could easily be changed all at once. Also by creating classes such as RDWeapon and RDCharacter, I was able to update the variables when the user made an action.

Demo

To view the source code or fork the project, please visit the project on Github.

ScoreTrack

An AngularJS web app that takes advantage of AngularJS's two-way data binding to provide real-time score results

NHS Redesign

Complete overhaul of a not-for-profit's website

HackTX

The Official HackTX App