Programming Help
Monday 13 June 2011
Glovepie
Glovepie is a programmable input emulator. It is thought to be made for the Wii remote or wiimote but it is not. It was originally made to emulate the glove 5 hand controller with the computer. It has expanded very far and can handle many different inputs including voice. GlovePIE stands for Glove programmable input emulator. Glovepie is a simple programming language but is very powerful.
The code in Glovepie can go in almost any order because it’s so simple. It’s coding is very easy to memorize and you could probably have most of it memorized in a few days. It was programmed in c++, the base computer programming language, so it can do almost anything and has few limits. The first thing I add into Glovepie is my variables. I usually put them in a if statement that ends after being read once so it won’t keep resetting the variables. If you don’t setup a variable it will be 0 automatically. An example below:
If(var.first == 0)
var.first = 1
var.firstvar = 15
var. secondvar = 20
endif
The next I add in is the code for the emulations I want to do. If you want to emulate the wiimote A button to control the mouse click you write “Mouse.LeftButton = Wiimote.A”. It is very simple. You can emulate many things such as the speakers, mouse, keyboard, controller, wiimote, voice, and even p5 controller. To emulate the voice you have to use an if statement. To emulate the voice you would write if you said something then do something. It can be written:
if said(“hello world”) then press(Key.A)
or you could do:
if said(“hello world”)
press(Key.A)
endif
If you tell the computer to press a key you should type “release(The key pressed)” so that it won’t keep holding the key. If the key is a letter or number an easier way would be to type “type(“a”)” to make it type the letter A. To add to a variable you would type “var.variable += 1;”. You can even type “var.variable += var.variable2;”. The variables work very well for everything you do and will be used in almost every program. Another way to use a variable, like in the average programming language is “var.variable ++”. You can play computer sounds such as the exclamation sound by typing “beepExclamation”. This concludes the glovepie tutorial. Hope it helps!
HTML
Welcome to the best tutorial you will ever find on HTML J. Html, unlike the average programming language, uses tags. Tags are like your code pieces except in the greater than and less than signs. So if you were going to put a piece of text in your site it would probably be written “<p>Your text here</p>”. Almost all sites are written in HTML and you probably have no programs on your computer written in HTML. HTML is very popular on the internet because that’s the basic sites coding.
There are many different tags for different uses. To import javascript into your site you would type “<script type="text/javascript">” and then to end the javascript you would type “</scipt>”. Whenever you want to end you tag you will usually use </tag name here>. Another tag is the <p> tag which stands for paragraph and you would use it if you were going to write some text. A useful header tag are the <h> tags. To use an <h> tag you would type “<h1>”, “<h2>”, “<h3>”, “<h4>”, “<h5>” or “<h6>”. The <h> tags all have different sizes <h1> being the largest and <h6> being the smallest.
There are also tags for changing how your font looks. You can use <b> for making something look bold. The b in <b> stands for bold. You can you <i> standing for italic. And you can even use <u> which stands for underline. All the tags are written in the same way and an example of the bold tag is ”<p><b>Text here</b></p>” . Those are the different formatting tags for html code.
Sunday 12 June 2011
Flash 8
Sorry everyone who wants to learn Flash CS5 I am learning it but im not too good at it. I have been learning Flash 8 for 2 years now and I’ve learned lots. If you need help and have a question feel free to post it in the comments section. It is a simple programming language but very powerful. If you need great help and are a beginner I would recommend “Actionscript Animation: Making things move!” In Flash Actionscript 2. If you want to learn more animation than code use “How to use Flash MX.” Flash MX is near Flash and the coding is basically the same. The setup is a little different. So on to the code…
The main frame has a basic setup and is very easy to use from the start. The timeline is at the top and that is what contains all the frames in your animation. In the center of the screen there is the stage. That contains everything you want to play. The stage can include text, buttons, movieclips, sounds, and even movies. On the right is where all the colour editing tools go and your library too. At the bottom is where your code and object properties go. On the left is where your tools go. And the file menu is at the top. Feel free to move anything around.
To start off in flash the first thing you will usually add code wise is “stop();” which ends the animation until you tell it to continue. So you can make an animation then put in “stop();” And your animation will stop. Stop is a very powerful command code wise and animation wise. It is used in almost every code snippet on the main frame.
The next part of your code will probably be setting up the variables. There are a few ways to setup variables. The easiest way is pretty straightforward and it “example = 10;”. You could also use “var example = 10;”. The second is just using “var” before which tells the computer that it’s a variable. The longest way is to use “var example:number = 10;”. The longest way tells the computer that it’s a variable and adds in a property telling what type; In the example I gave a number. There are other properties like string which is a group of letters put together.
The third part of code you will use will probably be something telling the computer what to do on each frame. The code to repeatedly check and enter code is “onEnterFrame = function(){“. There are many ways to enter it. For example. You could type “function onEnterFrame(){“, or “onEnterFrame = function(void){“. The second way has more options available in your code and the third is only used for special snippets of code. My favourite is the first way. Everytime you have “{“ you must put a “}” after to say that your ending that part of code.
The next code you add will usually be anything that happens inside the EnterFrame code. It could be an if statement telling what to do if something happens which is written “if(thisHappens){“ then do this: and after you do an if statement you must end it with a “}” of course. You could also want to add to a variable which is written “number += 1” or “var number += 1” or you could even subtract with “-“. You could tell a movieclip to move by typing something like “movieclip._x += 1” or “movieclip._y -= 1”. You can’t tell a movieclip to change its Z position though.
· All examples want you to remove “” from the code.
· Below is an example of code using everything taught above:
stop();
var example = 10
onEnterFrame = function(){
var example += 1
if( example > 15){
var example:number = 0
}
}
The above code tells the animation to stop. Then it says there is a variable equal to ten. Then it says to repeat everything below the onEnterFrame. It says the variable example has to add one. It says if example is greater than fifteen then var example equals zero. Then it says to end the if statement. And finally end the onEnterFrame statement so everything below that won’t repeat.
Subscribe to:
Posts (Atom)