Archive for the ‘Game’ category

Will Wright’s Hivemind

November 16th, 2011

Check out VentureBeat’s interview with Will Wright, creator of SimCity, the Sims, etc. It looks like he’s creating a game that will track your lifestyle and adapt the scenarios to real-world events.

It reminds me of the alternate reality game Majestic that came out in 2001. I had been part of the beta for that. The game called my phone and sent me emails as if it were real people being trapped in a conspiracy. I got too busy with, you know, living life, so I was done playing before it paused during the September 11 attacks on the World Trade Center. Majestic never recovered and closed up shop in April of 2002.

The big question is if people will play a game that incorporates their personal data into the big scheme of things. We put a lot of our data out there anyways, but for the most part we think through what we’re posting. All I know is that Will Wright would be the game design genius to pull it off.

ScriptTD – An Open Source Tower Defense Game Engine

November 8th, 2011

Coding4Fun has put up the source code for a tower defense game on Codeplex. With it, you can make a game for a Windows phone and even put it up on the Zune marketplace. If you can make an image in Paint, you can make your own game. What makes the project so cool, though, is that they put up all of the code. Everything can be adjusted.

Download the source code here.

ESRB for the mobile platform

June 30th, 2011

I just took a survey asking for my thoughts on the ESRB starting to rate mobile video games and it got me thinking about just how much I use the ESRB. The ESRB rates video games much like how the Rating Board rates movies. If you’re a parent, check out their site. They do a really good job of describing what’s in a video game. If you’re a gamer, check them out because they usually have the details for a game before even the news sites like IGN can get an update.

But with mobile video games, many apps are coded by small companies and not traditional publishers. That’s the beauty of the self-publishing online game marketplace. There’s a downside, though. The descriptions for the games in the marketplace don’t do the games justice and frequently leave me wondering what in the world the game is about.

Having the ESRB start to rate games would be helpful because that’s what they’re good at. I cringe at some of the summaries game developers put up. I would like a consistent style that gave me information about the game. Some of the proposed information will be whether the game takes your personal information and if the app transmits your location. That’s there in the marketplace, but depending on the store may only show up after you’ve already clicked on the app. A database with the ESRB’s established credibility will be nice.

I’m excited for the ESRB to start helping out. If anything, it shows that mobile gaming is becoming a legitimate platform.

Verb Volley and the History of Oregon Trail

January 21st, 2011

I was reading an article about the history of the Oregon Trail video game and learned that it was the result of two Math teachers and a History teacher being roommates. All three were in their first years of teaching and wanted a way to grab students’ attentions when learning about western expansion in the United States.

They programmed the whole thing in two weeks. That’s what reminded me of Verb Volley, a game I created one Fall Break to help my students review parts of speech.

Here’s my game:

Obama’s STEM Video Game Challenge

September 20th, 2010

This past week President Obama announced the STEM Video Game Challenge to encourage students to pursue math and science through engaging activities. The contest will be accepting submissions from October 12 to January 5. The entries can either be a game design on paper or a playable game. There is a $50,000 prize pool for students and it provides some great opportunities for careers in video game design.

Future Professionals, this is what we’re going to tackle first. Check out Scratch from MIT. It’s like an intro program to Flash and actually has some pretty decent scripting. (It’s free, too, which is always nice.)

Here’s how the judges will be determining the winners:

Submissions will be judged on a combination of fun and balanced gameplay, creative vision and incorporation of Science TEchnology and Math (STEM) concepts in game design and play experience.

Click here for a game that took me ten minutes to create. In no way does it meet the STEM requirements but it does illustrate a tiny bit of what Scratch does (that would take me much longer to do in Flash ActionScript.)

Try and get the face to the flower. Click on the green flag to get the party started. Arrow keys move the smiley.

Oregon Trail Online

August 17th, 2010


I’m helping a Social Studies teacher with her westward expansion lesson and we found Westward Trail, which looks very, very similar to the old Apple IIgs game we played when we were in elementary school.

You can find the game by clicking here. May your oxen be healthy and your axles unbreakable.

Side note: the original Oregon Trail is now on the Nintendo DS and on the iPhone and they are both worth checking out.

Re-posting: Creating a quiz game using ActionScript

March 31st, 2010

Today we’ll be looking at how to make a button-based game. We’ll need to run in ActionScript 2. The exciting part is that these games will be able to be put into the teachers’ SmartBoard software. Imagine the school playing a game you created.

    Setting up the Project

  1. Open a new Flash document.
  2. Click on Layer 1, Frame 1. Add a stop(); action to stop the playhead.
  3. On a new line in the code, establish a variable to hold the score.
    The code so far:
    stop();
    score=0;

    We set up the score variable here so we can change it as the user gets questions right.
  4. Create a new layer in frame 1.
  5. Create text as a title for your game (so the user isn’t staring at a white screen).
  6. Making a Button

  7. That’s great, but we need a way to get past this screen. We’ll need a button. Click on Insert->New Symbol and choose ‘Button’.
  8. Buttons have an Up, Over, Down, and Hit. Up is its natural state. Over is if some hovers a mouse over the button. Down is what it looks like when it gets clicked. Hit is the Hit Zone – if you want a bigger area to register if it’s been clicked on or not. Normally Hit is the size of a box around the button.
  9. Make a keyframe in each area to change the states of the buttons (what they look like). Notice that you can insert multiple layers.
  10. Drag that button onto the stage.
  11. The button is clickable, but it doesn’t know what else to do. With the button selected (blue highlight around it), open up the ActionScript for that button.
  12. Telling the Program to go to the Next Part

  13. Type on( . Remember from previous lessons that when we see the parentheses, it means the function is calling/looking for a variable. Most modern versions of Flash will try and guess which one you want. Select press. (When someone clicks the button, it goes. You could choose release and the user could click and hold and then go when the user releases the mouseclick.)
  14. Add a funky bracket ( { is called a brace, to be technical) to start your list of commands.
    The code should now be:
    on(press) {
  15. Start a new line to maintain style.
  16. Type in gotoAndPlay(2); Notice that the ‘A’ and the ‘P’ are capitalized. Also look at how the function calls a variable – the number ’2′ – to tell the game to go to frame 2.
    The code now is:
    on(press) {
    gotoAndPlay(2);
    }
  17. If you run the program right now, when you click, it will go to frame 2 (or even just consider frame 1 the end of the movie if you haven’t added anything yet to frame 2) but then loop back to frame 1. We need to put a stop(); code in frame 2 just like we did for frame 1. You’ll need to insert a blank keyframe and then click on the ActionScript arrow.
  18. Once you’ve added the stop();, on a different layer create text with your question.
  19. Use the Same Button Multiple Times to Make Your Life Easier

  20. We need buttons for our answers. If we create one button in the Flash library, we can then drag it in multiple times and not have to re-do animations. Create that button.
  21. Drag the button from the library onto the stage. Create a text box next to the button that has an answer.
  22. Drag the button from the library again onto the stage for the second answer. Put a text box next to the button with an answer.
  23. Checking for the Wrong Answer

  24. Click on the button next to the wrong answer to select it (blue outline).
  25. Let’s add some code for the wrong answer. Let’s add a gotoAndPlay(3); to the button (with the on(press) and all that) to take the user to frame 3, which is where we’ll mock them for getting the wrong answer. (Mock them nicely and politely.)
  26. Make sure to add a stop(); code in frame 3 to avoid the jumping loop. You’ll need to insert a blank keyframe.
  27. Create your end of game screen. Be nice and include a button to take us back to frame 1.
  28. Checking for the Right Answer

  29. Let’s say the user got the question right. Go back to frame 2 and edit the ActionScript for the correct answer button.
  30. Send the user to the next question – frame 4 – with a gotoAndPlay(4); What’s different this time, though, is that we need to add to the score. On a new line in the ActionScript type in score = score + 10; We just took the score and added 10 points to it. (It will still complete the rest of your list of commands – but to keep it straight in the minds of the humans who may be reading over your code later, add to the score first and then put in the goto.
    The code should look like:
    on(press){
    gotoAndPlay(4);
    score = score + 10;
    }
  31. Displaying a Score

  32. On frame 2, create a new layer. Let’s label what the user is looking at. Create a text box somewhere on the screen that says ‘Score’. If it’s on it’s own layer and it’s own keyframe, it will constantly say ‘Score’ throughout the whole program.
  33. Now let’s show the actual score. Click on the tool to make a text box, but instead of creating a text box, just click where you want to show the score.
  34. In the Properties at the bottom of the work area, change it from Static to Dynamic text. Dynamic and Static are just like with characters in a story – dynamic changes, static stays the same.
  35. In that text’s Properties, there’s a place called ‘Var: ‘ with an input box next to it. Type in score. It will now show the value for score. Make sure that you don’t put this in frame 1, because frame 1 is where we initialize/set up the variable.
  36. Thoughts to Enhance the Game

  37. You can add to score whenever the user clicks on the right answer button. You can subtract from score when a user gets the wrong answer.
  38. You can add as many buttons as you like – you don’t just have to have two questions.
  39. Not all buttons need to be easily seen. You could say “Click on the duck” but have the Up be blank and have the Over show a duck. The user would have to roll around the screen to try and find the right button.
  40. You can create a variable called whichframe to control which frame a gotoAndPlay goes to. Instead of gotoAndPlay(4); it could be gotoAndPlay(whichframe);

Isometric Game: Going to the Next Frame

March 10th, 2010

We’ve got the countdown showing on the hero for our game. If you weren’t at Future Professionals when we did that, here’s the link.

Let’s check when the variable scarytimer gets to zero. When it does, we’ll have the Flash movie go to frame two.

Find the line of code in the onEnterFrame function where you decrease scarytimer.
scarytimer--;

Underneath it, check to see if it’s less than 0.
scarytimer--;
if(scarytimer<0){
gotoAndStop(2);
scarytimer=0;
}

The gotoAndStop means that we don't have to put a stop(); code in frame 2. It reduces the amount of typing you have to do.

Notice that I added a line to set scarytimer to 0. Instead of going into the negatives, it's now an ominous emptiness.

Now draw/type a message on the stage in frame 2 that lets the player know that time has run out.

That's if they lose. But what if they win?

Find the line that says
if(canvas.map[hero.y][hero.x] == 101){
trace("Exit");
}

Change:
trace("Exit");

to
gotoAndStop(3);
scarytimer=1000;

On frame 3 create a message that lets them know they win. Make sure that frame 3 has a new keyframe so frame 2's message doesn't show up.

Isometric Game: Displaying the Timer

February 24th, 2010

Photobucket
If you have missed a couple of sessions, check here.

If you’ve been here the whole time, let’s continue.

  1. Open up the Flash file we’ve been working on.
  2. Edit your hero movieclip.
  3. Add a textbox above the hero’s head.
  4. Change the textbox from ‘Static’ to ‘Dynamic’.
  5. For the instance name, type scarytimer.
  6. For the Var:, type _root.scarytimer. (_root lets us know that the variable exists on the main level of the stage and not just privately with the movieclip).
  7. If you don’t want the timer text to be selectable by a mouse, make sure the ‘Ab’ button is not selected.

A variation on this would be to create a new tile with the timer on it and spread those tiles throughout your maze.

Your dynamic text settings should look something like this:
Photobucket

Continuing with the Maze Game in Flash: Beat the Clock!

February 10th, 2010

We’re going to add a simple timer to our maze game that we’ve been working on. (If you’ve missed a few sessions, start here.)

We want the timer to start at 1000 and count down to the player’s imminent doom.

To set up the initial value for the timer, let’s create a variable called scarytimer.
var scarytimer:Number=1000;

Put that code at the very top, outside of any functions. If a variable is defined in a function, other functions will see it as undefined. So, at the top of the AcionScript, type in:
var scarytimer:Number=1000;
right above where you see
var tiles:Object = new Object({width:52, height:26});

The player will start with 1000 loops to be able to get to tile101, tile101 being our special tile from last time.

Now we need the player’s doom.

In the onEnterFrame function, we need to subtract from scarytimer each time the game loops in a frame.

Way back in the olden days when I programmed stone tablets for pterodactyls, we would write scarytimer=scarytimer-1 to subtract gradually from the variable with each loop.

ActionScript has simplified it with the code:
scarytimer--;
The two minuses tell ActionScript to subtract one increment from the variable.

Put scarytimer--; right above where you see input();

Variables get tricky when trying to determine what value they have. Run a trace on the variable to have the computer tell you what value scarytimer has.

scarytimer--;
trace(scarytimer);

Now the code will decrease scarytimer and then spit out its value to you.

Run your file right now to make sure your variable works. If it doesn’t, everything else will get nasty quickly.