Wednesday, May 7, 2014

Input Workshop: Level 1 - Arrows

The main difference between movies and games is.... Interactivity.

Input is a pillar of video games, since the beginning developers have tried to use all sorts of input devices in order to create new experiences. some examples include the arcade joystick, the two button NES controller, the zap gun, Wii mote, kinect, and many different sorts of devices.

For this track it is important to create an easy to use control system, you always want your players to intuitively learn how the game is controlled.

Our first Workshop is a simple one, Lets try moving the character from left to right by using the arrow keys. There is an example of this on the Problem Solving Method page, but it is still good to see if you can develop it without using that as an example.



Flash a very handy tool, and it works great for testing input.

I am jumping a bit ahead here, but here is a piece of code, I will try to explain it.

public function KeyDown(e:KeyboardEvent)
{
     trace(e.keyCode)
}

Let me explain all the components

  1. public - The other option is making it private.
  2. function - Think of yourself, a variable is the color of your eyes, a function is you jumping.
  3. KeyDown- this is just a name I gave the function it could have been anything, but it is usually good to choose a name that is related to what the code inside does.
  4. e - this is a name of a variable, I could also have chosen any name here.
  5. KeyboardEvent - This is a type, so what I am saying here is that I will have an object name e that has a bunch of variables and functions (the ones inside object KeyboardEvent)
  6. trace - this is a function that will output to the output console a text or a variable you choose.
  7. keyCode - this is a variable located inside the object e, remember that e is a KeyboardEvent the link will show you all the variables and functions that are available

That's it, this is step 1 in our Input Game Dev Workshop, please make sure to send me a screenshot of your completed file, or if you want to share some of the Sketches that would be great as well. Once I get the image I will try and post your updated Badge as soon as possible.






No comments:

Post a Comment