Monday, July 11, 2016

buttonaction (motion)

function atnbgstartmotion(motion) {
safetystop()

function safetystop() {
var motion = document.getElementById("atnbgmotion")
motion.innerHTML = 0 + motion.innerHTML
setTimeout (startmotion,100)}

function startmotion() {
var motion = document.getElementById("atnbgmotion")
var m = motion.innerHTML[1]
if (m === "l") {leftmotion()}
if (m === "r") {rightmotion()}
if (m === "u") {upmotion()}
if (m === "d") {downmotion()}
if (m === "p") {plusmotion()}
if (m === "m") {minusmotion()}}


}