Android Tutorial Hangman Tutorial (part 1)

Hi, I'm Eric. I am still fairly new to Basic4Android, but have dabbled off and on in programming for the last 20 years. I started programming with GWBasic back when I was about 11. It took me quite a long time to learn things in those days (we didn't have the internet), but I eventually learned how to write some simple code that resembled games and such. Since my very first attempts at creating games, I have never lost the thrill of seeing my creations come to life on the screen.

Much later, during the big 3D games explosion (think Wolfenstein, Doom, Quake, etc...) I wasn't able to keep up with the advanced math that was used to make those sorts of games. Assuming this was the de facto future of all game programming, I made several attempts to try and learn the 3D type of programming. All of these failed. I can't do it even today (maybe with some of the cool 3d game engines it has become easier). That was it... my game programming dreams were crushed...

THEN- along came the explosion of mobile gaming. Not only did I enjoy playing some of these 2D style games again, but sure enough, almost 20 years later, I realized that this might be the right platform for me to pick my dreams of game programming back up!

So, I downloaded Eclipse, got some Java programming books, XML books, watched tutorials on Android and Java programming, and tried my best. BAM! it hit me... This is some hard stuff! I didn't get an education in programming, and as a married guy with a full time job and other more important responsibilities, I didn't have nearly the amount of time I would need to become great at programming in this new (to me) Java language.

My programming dreams were again CRUSHED!

THEN... I found it. One night just cruising the web on my android phone before bed... BASIC 4 Android. This has to be it! The REAL answer to my needs to get back into programming. I looked at the forums, checked out the demo, and my credit card was just BEGGING to be used to get the full version of this program. This was going to be my best opportunity of having the right tool, to write in a familiar language, to make the games I wanted to make!

I can't say that my brain responded very well to the crazy demands I was placing on it at first. After all, it had been at least 10 years (or longer) since I really did any real programming. But, after only a few weeks with Basic4Android, I was able to create and publish my first app to Google Play! The app is called Dice with Benefits (caution... shameless plug) and it can be found here: https://play.google.com/store/apps/details?id=com.dice.with.benefits It is a pretty simple app that helps people who play Dice with Buddies get lots of 'Bonus Rolls' without having to spend a lot of money.

(Note for the morality police: this isn't a true 'hack' in the sense that I do not modify any part of the Dice with Buddies game, or database therein, Dice with Buddies allows users to get free bonus rolls by sending text invites to a bunch of their contacts. My app just generates up to 999 fake contacts that don't have a phone number so you can invite the 'fake' contacts to get your rewards, which prevents you from text-bombing your real friends...)


WELL... now that you know a little about me- here is the real meat an potatoes of this thread:


How to make a Hangman game in Basic4Android.

I am going to start this off by posting a game flowchart. In my experience, creating a flowchart for your game (or apps in general) is a great way to visualize what your game should do, and how it should react at different times.

It is best to keep these fairly simple, but to make sure the important things are there. Decision branches are almost always important, and creating a START and END is also a good place to start.

Here is the flowchart I have created for this game:

hangman flowchart.png


(I created this using the free version of gliffy.com's flowchart tool)

If you aren't sure how to read a flowchart, here is an explanation: http://en.wikipedia.org/wiki/Flowchart

As yo can see, the flowchart shows the natural progression of the game, and helps us visualize the things that we need to include in our program.

If you have never used a flowchart as a tool for programming, give it a try! You don't even have to know any programming to create a flowchart. Think of any of the board games that you have played, and they could all be broken down into a flowchart. Simplicity is key here- as most popular games are based on a very simple set of rules that get applied to a bunch of individual scenarios.

This concludes part 1 of the tutorial. Add this thread to your watched threads to be notified when the next part is available.


Please note:
This thread is going to be a work in progress, as I am trying to teach as I learn things myself. I also welcome any and all comments, suggestions, feedback, criticism, etc... as I want this to be a good beginner's tutorial to programming one of the simpler games out there that should be familiar to most people.



Part 2 here: http://www.b4x.com/android/forum/threads/hangman-tutorial-part-2.32894/
 
Last edited:

Similar Threads

Replies
49
Views
57K
Replies
278
Views
160K
Replies
120
Views
177K
  • Locked
  • Article
Android Tutorial SQL tutorial
Replies
161
Views
276K
Top