Exemplo n.º 1
0
						public void Move (GUtils.Direction dir)
						{
								switch (dir) {
								case GUtils.Direction.n:
										y += 1;
										break;
								case GUtils.Direction.e:
										x += 1;
										break;
								case GUtils.Direction.s:
										y -= 1;
										break;
								case GUtils.Direction.w:
										x -= 1;
										break;
								case GUtils.Direction.ne:
										y += 1;
										x += 1;
										break;
								case GUtils.Direction.se:
										y -= 1;
										x += 1;
										break;
								case GUtils.Direction.sw:
										y -= 1;
										x -= 1;
										break;
								case GUtils.Direction.nw:
										y += 1;
										x -= 1;
										break;
								default:
					//nothing
										break;
								}
								;
						}
Exemplo n.º 2
0
						public Vector2 VirtualMove (GUtils.Direction dir)
						{
								Vector2 newpos = Position ();
								switch (dir) {
								case GUtils.Direction.n:
										newpos.y += 1;
										break;
								case GUtils.Direction.e:
										newpos.x += 1;
										break;
								case GUtils.Direction.s:
										newpos.y -= 1;
										break;
								case GUtils.Direction.w:
										newpos.x -= 1;
										break;
								case GUtils.Direction.ne:
										newpos.y += 1;
										newpos.x += 1;
										break;
								case GUtils.Direction.se:
										newpos.y -= 1;
										newpos.x += 1;
										break;
								case GUtils.Direction.sw:
										newpos.y -= 1;
										newpos.x -= 1;
										break;
								case GUtils.Direction.nw:
										newpos.y += 1;
										newpos.x -= 1;
										break;
								default:
					//nothing
										break;
								}
								;
								return newpos;
						}