public void load(Player p,World m) { p.cameraPosition = cameraPosition; p.worldPosition = worldPosition; p.facing = facing; p.state = state; p.jump = jump; p.jumpSpeed = jumpSpeed; p.gravity = gravity; p.speed = speed; p.prevstate = prevstate; p.frameSize = frameSize; p.currentFrame = currentFrame; p.Life = true; m.mapX = mapX; m.MapW = mapW; astral = false; }
public void Start(ContentManager ct) { /*Elementos de los mundos */ ListMap = new World[2]; Texture2D tex0 = ct.Load<Texture2D>("in"); Texture2D tex1 = ct.Load<Texture2D>("Loco_Ground"); Texture2D tex2 = ct.Load<Texture2D>("ladder2"); Texture2D tex3 = ct.Load<Texture2D>("ground1"); Texture2D tex4 = ct.Load<Texture2D>("palanca_Sheet"); Texture2D tex5 = ct.Load<Texture2D>("Ice_Block"); Texture2D tex6 = ct.Load<Texture2D>("Pua"); Texture2D tex7 = ct.Load<Texture2D>("monster-lizard"); Texture2D tex8 = ct.Load<Texture2D>("Flame"); Texture2D tex9 = ct.Load<Texture2D>("Door_sheet2"); List<Texture2D> ListaElem = new List<Texture2D>(); ListaElem.Add(tex0); ListaElem.Add(tex1); ListaElem.Add(tex2); ListaElem.Add(tex3); ListaElem.Add(tex4); ListaElem.Add(tex5); ListaElem.Add(tex6); ListaElem.Add(tex7); ListaElem.Add(tex8); ListaElem.Add(tex9); /*Level 0 */ int[,] activableElemsMoves = this.LoadMap(0, "Content//activableMoves"); int[,] activableMap = this.LoadMap(0, "Content//activable"); int[,] MapWorld = this.LoadMap(0, "Content//map"); int[,] astralObjects = this.LoadMap(0, "Content//astral"); World map = new World(MapWorld, astralObjects, activableMap,activableElemsMoves, ListaElem); ListMap[0] = map; /*Level 1*/ int[,] activableElemsMoves_1 = this.LoadMap(1, "Content//activableMoves"); int[,] activableMap_1 = this.LoadMap(1, "Content//activable"); int[,] MapWorld_1 = this.LoadMap(1, "Content//map"); int[,] astralObjects_1 = this.LoadMap(1, "Content//astral"); World map1 = new World(MapWorld_1, astralObjects_1, activableMap_1, activableElemsMoves_1, ListaElem); ListMap[1] = map1; }
public void save(Player p,World m) { texture = p.Texture; cameraPosition = p.cameraPosition; worldPosition = p.worldPosition; facing=p.facing; state=p.state; jump=p.jump; jumpSpeed=p.jumpSpeed; gravity =p.gravity; speed=p.speed; prevstate=p.prevstate; frameSize=p.frameSize; currentFrame =p.currentFrame; mapX = m.mapX; mapW = m.MapW; source = p.source; rectangle = p.rectangle; astral = true; }