Sunday, December 11, 2016

motion

function atnbg20161211su1710(instruction) {
var namespace = "atnbg20161211su1710"var iarray = instruction.split("<i>")
var iname = iarray[0]
var i = iarray[1]
if (iname === "buildmotionbar") {buildmotionbar(i)}
if (iname === "startmotion") {startmotion(i)}
if (iname === "move") {move(i,namespace)}
function startmotion(i,namespace) {
document.getElementById(namespace + "_motion").innerHTML = 1
if (i === "up") {upmotion()}
if (i === "down") {downmotion(namespace)}
if (i === "left") {leftmotion(namespace)}
if (i === "right") {rightmotion(namespace)}
if (i === "plus") {plusmotion(namespace)}
if (i === "minus") {minusmotion(namespace)}}
function upmotion() {
if (document.getElementById(
var whattomove = document.getElementById(namespace + "_whattomove").innerHTML
var whattomove = document.getElementById(namespace + "_" + whattomove)
var speed = parseFloat(document.getElementById(namespace + "_speed").innerHTML)
whattomove.style.top = parseFloat(whattomove.style.top) + speed
setTimeout (upmotion,100)}