What could POSSIBLY go wrong?

The game play layout.

This is the picture of what the game play layout would be.

I’m creating a game that combines a multitude of my favorite elements from other games. I’m not sure what it’s going to be called yet, but the working title is “Bookworms”. The story involves bookworms getting into a library and eating through the books. The player must move themselves around the library to collect words. However, with each word collected a bookworm, a bookmark, or a coin will appear. If the user is hit by a bookworm then a dollar is added to the “library fine”. Once the “library fine” reaches five dollars, then it’s game over. The user can also use the bookmarks to combat the bookworms by pressing the space bar.

Start page wireframe

The beginning page of the game that the user can begin.

The first thing players will see when starting the game will be a simple background of a faded bookshelf and in the foreground would be all the information needed for playing the game. The first line or two will tell the story of the bookworms and the objective- such as what the player needs to do . Then after will be a simple line about the controls. A picture may or may not be included, as the picture would be a space bar and the arrow keys. On this first page there is also a small picture of a book worm and an explanation to what they are, a picture of a coin and an explanation and a bookmark and what it does.

Victory end layout

This will display the paragraph of the story that was completed.

The next page is the game page. On the game page the player will begin in the lower left-hand corner and a word appears at random on the stage. On the top of screen will be the level number and to its left will be a count of the words total and underneath that will be the count of words collected. Once those two numbers match the level is over. On the right side will be the library card fine number and under will be the amount of bookmarks that have been collected.

Once the two numbers match up the game will go to a third page. On that page will be a paragraph/selection of a story that the words on the level were from. The passage will be full and intact and the user will have the option to press “next part” to get the next section of the story or “end game” to get to the final page.

End of the game page

This is the end of the game. It can work at the end of both scenarios: Fines and the gamer wanting to quit.

The final page will list the total cumulative words collected over the levels and give the user the option to start a new game with a new story.

My toughest problem with this game is figuring out how to create it so the stories and arrays are able to be pulled out for the game at random. That way, it isn’t the same story each time. Unfortunately, unless I can create an efficient way to do this, I will have to keep the story to one or two different stories. I really wish to use many more.

Riddle Me This….

The End of My Game

Yeah. I was feeling a little morbid at the end of things. But it’s funny. Kinda. To me at least.

For this program we were assigned to create a game based off of the riddle of the farmer who has a goose, a cabbage, and a wolf and needs to get them all across the river. The goose and the wolf cannot be left alone together nor can the goose and the cabbage. My version of the game can be found here.

As you can see, it works okay. The program recognizes when you cross the river and you can pick up and move all three of the items. If you make a mistake and get the riddle wrong then there is blood and you get a message saying you lose. If you get the riddle correct, you get a message saying you’ve won. However- there are some bugs that I haven’t been able to solve and I’m not sure how to go about fixing them.

Flash Error

I’m not exactly sure how to fix this code…

The first error really can’t be seen here. But I keep getting an error message when adding the blood onto the stage and removing the two other items from the stage (like the wolf and the goose). The error message is pictured to the right, and I’m not sure how to get the error message to go away. It’s strange though, because with this basic code the error message doesn’t interfere with the actual game play so I can’t even really tell what part of the game is so buggy.  I mean, I have the error message tell me what line the error is on- but that’s it. I’d rather have it be buggy and make something strange happen then have it be buggy and have nothing happen.

Small snippit of Flash code

I’m trying to think of how to make sure the program goes through the entirety of this code when I want it to go until a certain point. I know there’s a way to, but I’m not sure what that is.

My second issue involves logic and me not being able to wrap my head around said logic. I had the code pictured to the left in my program. This was theoretically supposed to make it so that when the alligator was on one side, it would check the requirements and make it so that it moved from one side of the stage to the other and back. Unfortunately, it doesn’t work as you can see in the main file. Well. It does work. But every event frame has it firing through the if-then statement and so it gets to the first condition and if it’s not satisfied it goes to the second. But then it does it again, super fast, and the first condition isn’t satisfied anymore so it fills that. So basically- the code isn’t getting to the second condition when I want it to and I don’t know how to fix it.

But now, I’m going to leave behind these two headaches and go home to my family and my horse. My horse, King, pictured below.

My horse, King

This is my horse, King. He likes the camera.

I Want the Gun in My Game to Shoot Kryptonite

Game Over screen

This is the game over screen I made. It really isn’t anything special: just dynamic text. But it works! That’s what’s important.

When writing a how-to book, especially a how to book on a subject that is as complicated as programming, it is imperative that the author allows for the user to check his or her code every so often. Otherwise, the author is requiring a great deal of faith from the user that they will not lead the user astray. Unfortunately, this rule of thumb was not necessarily followed by the author of the book we used for this project. Our job was to create an air raid game, where users could move a gun at the bottom of the screen, press the space button to fire a bullet, and have the bullet detect when it hit a plane. Then the plane would explode and the user would get a point. The game let the user play until the user ran out of hits (the user begins with twenty chances).

Like I said before, my biggest issue with this came in that I had to just trust that the author wasn’t leading me astray. I couldn’t check the code as I went, so I had no idea if I had made a mistake at some point until the end. Then, once I finished, I had an error. I had no idea how to fix the error as I had no feedback from the game, it just wasn’t working. I then resorted to opening the completed file and looking at my code versus the one that the book had. I went line by line, checking my code and then checking theirs until I saw where the disconnect was. I then fixed it and when I had fixed all the errors made in my code so it looked like theirs, it started working. And what a great feeling that was! It is not the most advanced game in the world, but it is my game and if anyone has an issue with it then they can just… not say anything about it. After I finished doing things by the book I gave it a game over screen myself as well as changed the airplane to parasprites. I much enjoyed having that creative freedom, and I usually find it much easier to remember what I code and how I coded something when I use something I’m interested in. Like ponies or superheroes. Or superheroes and ponies.

Marvel Masterpieces featuring Deadpool and Pinkie Pie

One of my favorite pictures.

Frustration Often Attacks When I’m Driving in Traffic or When I’m Coding

Final Flash Animation

This is what I got after a few hours of working on this assignment.

This was one assignment that ended up frustrating me more than usual. I came across a lot of issues that weren’t necessarily addressed in the book, especially in the first part of the assignment dealing with the little dots. In the end I was frustrated enough to find the code that the book had online and open up that file to compare. I had almost everything the code did that the book had except for a few lines that I realized I had been missing. Once I entered in those codes I was able to finish the rest fairly easy to do using the logic that has been implemented through the semester.

Some of the issues were fairly trivial and were a consequence of the differing sizes of the stage we were given versus the size of the stage the code was programmed for. This caused the airplane to vanish prematurely (only after I managed to find the remove plane function… before then it would just give me an error message once the plane hit where it was supposed to disappear). I had to find the part in the code where it was talking about the size of the stage and put in a different number for the width so that not only would the airplane stay the proper length, but the gun would move as well. For some reason, this was more difficult than it should have been for me.

It's just my failed dots. Don't worry about it.

The dots exploded and would go in one direction it seemed. I have no idea what I’m doing.

When I was dealing with the sample at the beginning with the little dots, I faced my biggest moment of frustration. I understood the code enough, and I understood what it was supposed to do. What I didn’t – and still don’t – understand was why the code worked fine when giving everything a set number, but when I went to randomize the speed and set the location (I could set x or y, but not both) nothing happened. It’s most likely an error on my part, but it doesn’t change the fact that I still blame the computer. Another issue with this little code was with the issue that it didn’t stop at fifty instances. I tried various different solutions I could think of- solutions that worked in the past- but I still got a mass amount of the dots and I don’t know how to fix it.

This assignment took me a few hours to do and I ended up needing to take a few breaks. Unfortunately, for a lot of the first part of it, I couldn’t. I’m still not completely sure on a lot of the elements of the Air Raid with the airplanes and the arrays and what not, but I feel I do have a better understanding. At least I understand how to make the computer listen to the arrow keys and how to make things happen once a button is pushed. I wonder if a part of the problem was that I’m used to coding in CS6 and the book is CS5? Or is that really much of an issue? I noticed the use of “public” in a lot of places I wouldn’t normally use it, but it didn’t seem to make much of an issue. Oh, and for  the first time I dealt with the issue of putting semicolons in too many places.

Stars, Stars, Stars

Actionscript Code

This is the final code for the project.

In this exercise we had four different buttons we needed to set up. That was the easy part. The difficulty conceptually came in connecting a second actionscript file. The code part was easy, but I still don’t really understand the reasoning behind it. I don’t understand how the actionscript file can be directed towards the indicated file and what the constraints are. Do they have to be in the same file folder? I know in web design when referring to a font or a picture that’s in another folder  there’s a way of writing the path, but does the same apply in actionscript?

Flash With Lots of Stars

After pressing the “insanity” button this is the scene that should appear.

Other than that, I had a small issue that I was able to solve on my own using google. I was unsure how to make each star a different alpha at random. I couldn’t use the same methods I had before as alpha is only decimals and Math.Random() * ____; is not the best for that. But after a google search I found the answer was not far off. In order to keep the alpha randomization on the insanity button, I put the code under the “add child” in the function for the events that followed the insanity button. The code I put was “myStar.alpha = Math.Random();. And that was all I needed to get the stars to appear at different alpha values.

Squeaky Clean

This assignment was both difficult and yet very eye-opening. I managed to try new coding combinations to get the sentences exactly how I wanted them. I have fallen in love with the “split()” and “join()” functions, and used them both to get exactly what I wanted. I have also become incredibly enchanted with the idea that one can write the name for the function, and then do a long list of things to that passage simply by adding “.” to the end of it. I ended up learning how clean these codes can look by having what would otherwise be lines and lines of messy code and is now simply one long line of code.

Flash Interface

This is my final for-loop code and the code above it to get the proper letter out based on the button pushed. I think it looks very clean. I like clean codes, they’re much easier to read.

The most difficult part was figuring out what needed and what didn’t need to be said in the code for the for loop. That took me a long time to figure out the syntax. I wish APIs were not done in such confusing language, but alas, I must learn how to speak like the reference guide. I’m excited though to start on the hangman game- I just hope I don’t get too caught up in design that I leave myself no time to actually work on the code!

I am trying to get the link to the public viewing of the final file, but unfortunately (It’s either my computer or Dropbox), Dropbox is being a little bit of a butt. There must be some system maintenance going on. I will link to my final letter madness flash creation once it starts working again or I can get on the computers in the communication lab.

 

Edit:

Here is the link to my final product.

Only Pushing Some Right Buttons

For this assignment we had to hook up seven different buttons, all that would do something different to the passage above. My final project is located here. I ran into a few problems with this assignment, and I’m not sure how to fix them and I couldn’t quite find a solution. Every time I tried to find one I would end up confused and the language of the text or websites that were offering help would be too high for me to quite understand at this point with all this technical jargon.

Flash Interface

This was the point where I decided to try and make it so the computer counted how many letters there were without spaces. “O” is the letter that was with spaces, “a” is the letter without spaces. I still don’t know how to make it change when the word “We” is replaced with “ponies”.

My first error that I couldn’t solve involves changing more than one instance of “we” into “ponies”. I was trying to think of the best and easiest way to do this, but I couldn’t think of it. I was contemplating a for-loop, but I still don’t quite understand the boundaries of a for-loop’s ability. The second error that I had, one that again I’m not completely sure if I’ve even diagnosed correctly, is the “find x Letter” command. I can get the correct letter to come out (if I remembered to change the number in the code back to 83 after trying my debugging tricks- if not I apologize!), minus the spaces. I turned it into an array, removed the spaces, then put it back into a string. I got the 83rd letter and then I realized it: That letter, nor does the character count change when changing “We” to “ponies”. 

I had to wonder for a bit what caused that problem. Is is the computer going back to the original passage and not acknowledging the previous changes? That’s what I thought, and still think, but I’m not sure how to fix that. How to make sure the computer knows to apply the changes to the new passage and not the original one. Any ideas on how to fix that?