Ajax javascript problem with player going off the screen

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
AnnaMandos
Posts: 12
Joined: Tue Mar 15, 2011 10:28 am

Ajax javascript problem with player going off the screen

Post by AnnaMandos »

Hi i was hoping you could help me with this issue... basically in the interface while the player travels to the edge of the screen say the right hand side of the screen, the player transports to the left and same thing in the oppsite manner. Halls explains this well in the second vid i think but i dont believe ive changed much for it to happen ... if i can remember the sprite stopped at the edge of the screen...
If the sprite goes to the top of the screen it disapears, same with the bottom of the screen.

I goto the file from:
Ajax/Javascript Vid Tuts
http://www.mediafire.com/?lpdd5naxh6lo42o

for (i=0;i<=659;i++)
{


var divTag = document.createElement("div");

divTag.id = "div" + i;

//divTag.style.margin = "0px auto";


divTag.className ="dynamicDiv";

//divTag.innerHTML = "HE";

document.getElementById("maparea").appendChild(divTag);

}
document.getElementById("maparea").style.backgroundImage = "url(http://localhost/***********/images/grassback1.png)";
travel(map);


ALSO for some reason i have to insert url(http://localhost/***********/images/grassback1.png) to get the background image not sure why that is?? when originally it worked url(images/grassback1.png)

Any light on this would be extremely greatful
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Ajax javascript problem with player going off the screen

Post by Jackolantern »

Moved to Advanced Help and Support (advanced due to dealing with client-side coding and real-time animation effects).
The indelible lord of tl;dr
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Ajax javascript problem with player going off the screen

Post by Xaleph »

Relative urls are reference problems, so either you went deeper into the code ( maybe sorting out images or the like ? ) and the other one is where you say that the maparea gets the background image. Now, i`m not sure if thats intentional or not, but i think you want the div to have that background image. Could be me tho..
Post Reply

Return to “Advanced Help and Support”