Retro RPG/MUD

Talk about game designs and what goes behind designing games.
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Retro RPG/MUD

Post by hallsofvallhalla »

ugh blaahaha this is a struggle.

this is a snippet of the movement code and tryinh to make collisions to work

Code: Select all

 function keyListener(e){
            if(!e){
                //for IE
                e = window.event;
            }
     //////////////////////////////////////////////////west(left)//////////////////////////////////      
		     if(e.keyCode==65 && playerLeft > 5){
                //keyCode 37 is left arrow
            ////////////////collison//////////////////
				for(i=treeamount;k>0;k=k-1)
			   {
				   if (eval(tree+k).style.left < player.style.left);
			    {collision = 1;}
				  }
				if (collision != 1){
				playerLeft -= 8;
                                player.style.left = playerLeft + 'px';
				}
				movewest();
								 
            }
i finally got the php array that holds all locations for x number of trees into JS but left and top have px in it. So no way of comparing the two. I need to think of an alternative. Not only that its going to massive coding adding each image height and width to the top and left then checking each type of image. My god so much coding :)
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Retro RPG/MUD

Post by hallsofvallhalla »

ah good ole clip string...:) i am back in business
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Retro RPG/MUD

Post by SpiritWebb »

Glad that helped you out!! I can seem to find things when people need them, but when I need it, I cant seem to find it...story of my life!!! lol
Image

Image
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Retro RPG/MUD

Post by hallsofvallhalla »

yeah same here.
Post Reply

Return to “Game Design”