void AddItem(ItemType_6 type, float positionX, float positionY, float speed) { AddItem(type, positionX, positionY, speed, new Vector2(0, 1)); }
void AddItem(ItemType_6 type) { //random item, random side, direction, random speed side = rand.Next(0, 4); switch (side) { //left, top, right, bottom case 0: //direction = new Vector2(1,0); direction = Vector2.Zero; entryPosition = randomStartLocation(side); break; case 1: //direction = new Vector2(0,1); direction = Vector2.Zero; entryPosition = randomStartLocation(side); break; case 2: //direction = new Vector2(-1,0); direction = Vector2.Zero; entryPosition = randomStartLocation(side); break; case 3: //direction = new Vector2(0,-1); direction = Vector2.Zero; entryPosition = randomStartLocation(side); break; } AddItem(type, entryPosition.X, entryPosition.Y, rand.Next(2, 5), direction); }
void AddItem(ItemType_6 type, float positionX, float positionY, float speed, Vector2 direction) { LevelItem_6 item; item.Time = timeCursor; item.Type = type; item.PositionX = positionX; item.PositionY = positionY; item.Speed = speed; item.Direction = direction; levelItems.Add(item); }