Difference between revisions of "Team:KU Leuven/Secret"
Line 118: | Line 118: | ||
if (hero.x < 0){ | if (hero.x < 0){ | ||
hero.x=canvas.width; | hero.x=canvas.width; | ||
+ | if (hero.y < 0){ | ||
+ | hero.y=canvas.height; | ||
+ | } | ||
+ | if (hero.y > canvas.height){ | ||
+ | hero.y=0; | ||
+ | } | ||
} | } | ||
− | if (hero.y < 0){ | + | else if (hero.y < 0){ |
hero.y=canvas.height; | hero.y=canvas.height; | ||
+ | if (hero.x > canvas.width){ | ||
+ | hero.x=0; | ||
+ | } | ||
} | } | ||
− | if (hero.x > canvas.width){ | + | else if (hero.x > canvas.width){ |
hero.x=0; | hero.x=0; | ||
+ | if (hero.y > canvas.height){ | ||
+ | hero.y=0; | ||
+ | } | ||
} | } | ||
− | if (hero.y > canvas.height){ | + | else if (hero.y > canvas.height){ |
hero.y=0; | hero.y=0; | ||
} | } |
Revision as of 13:34, 27 August 2015