Post by dk on Jul 5, 2014 22:47:55 GMT
Can someone please do some very very basic java script samples so us arty types can begin to aquire a little more understanding of how JavaScript works in Hippo? I have been through the Java descriptions on the Hippo Help site but these really are just descriptions of what the code does and not practical examples of it in use. The first couple of basic tutorials are great and set out some good examples of JavaScript in Use but alas just merely enough to get a taste and left me wanting more.
For instance, how do we make a simple shape move from side to side using buttons? I have looked at the samples in the gallery and tried to strip down the data to the bare basics but the scripts are so overcrowded with other data it's impossible to work out what's going on. Searching the web for examples of JavaScript is useless as the scripts are mostly meant for use in web applications and don't work in Hippo throwing up error messages.
Example,I Come from an Actionscript background and to get an object to move you simply assign the code to a button or keypad ie
on (keyPress "<Left>") {
var x;
x = x-2;
lr = _root.h+x;
_root.mover._x = lr;
}
on (keyPress "<Right>") {
x = x+2;
lr = _root.h+x;
_root.mover._x = lr;
}
on (keyPress "<Up>") {
var y;
y = y+2;
ud = _root.v-y;
_root.mover._y = ud;
}
on (keyPress "<Down>") {
y = y-2;
ud = _root.v-y;
_root.mover._y = ud;
}
Any very simple examples on the basic application of Hippo Java scripting would be most appreciated.
Maybe some examples could be:
*Moving objects LEFT, RIGHT, UPWARDS, DOWNWARDS with buttons or keypad.
*scrolling a background
*adding audio to events like a bomb dropping
*Collision detection
*Firing an object
*Basic scoring
*Jumping
Thanks
dk
For instance, how do we make a simple shape move from side to side using buttons? I have looked at the samples in the gallery and tried to strip down the data to the bare basics but the scripts are so overcrowded with other data it's impossible to work out what's going on. Searching the web for examples of JavaScript is useless as the scripts are mostly meant for use in web applications and don't work in Hippo throwing up error messages.
Example,I Come from an Actionscript background and to get an object to move you simply assign the code to a button or keypad ie
on (keyPress "<Left>") {
var x;
x = x-2;
lr = _root.h+x;
_root.mover._x = lr;
}
on (keyPress "<Right>") {
x = x+2;
lr = _root.h+x;
_root.mover._x = lr;
}
on (keyPress "<Up>") {
var y;
y = y+2;
ud = _root.v-y;
_root.mover._y = ud;
}
on (keyPress "<Down>") {
y = y-2;
ud = _root.v-y;
_root.mover._y = ud;
}
Any very simple examples on the basic application of Hippo Java scripting would be most appreciated.
Maybe some examples could be:
*Moving objects LEFT, RIGHT, UPWARDS, DOWNWARDS with buttons or keypad.
*scrolling a background
*adding audio to events like a bomb dropping
*Collision detection
*Firing an object
*Basic scoring
*Jumping
Thanks
dk