Imports System.Collections.Generic
Imports Microsoft.VisualBasic
Dim niveau As new Niveau(dimX, dimY)
Dim pos As Point = new Point(1,1)
niveau.Zone(1,1) = new zone(zoneType.floor)
niveau.Zone(1,1).Elems.Add(LeHero)
cEntry = Console.ReadLine()
move(cEntry, Lehero, pos, niveau)
Public sub move(cEntry as char, ByRef entity As Entity, ByRef pos As Point, ByRef niveau As Niveau)
target = new Point(pos.X, pos.Y-1)
target = new Point(pos.X -1, pos.Y)
target = new Point(pos.X, pos.Y + 1)
target = new Point(pos.X + 1, pos.Y)
if niveau.zone(target.X, target.Y).Type = zoneType.floor then
niveau.Zone(pos.X, pos.Y).Elems.Remove(entity)
niveau.Zone(target.X, target.Y).Elems.Add(entity)
Public sub Update(ByRef niveau As niveau)
Dim dimX, dimY As new Integer
dimX = niveau.Dimensions.Width
dimY = niveau.Dimensions.Height
if niveau.zone(j,i).Elems.Count > 0 then
If niveau.zone(j,i).type = zoneType.Floor
public Property Dimensions As Size
public Property Zone(ByVal i As Integer, ByVal j As Integer) As Zone
public sub New(dimX As Integer, dimY As Integer)
Me.Dimensions = new Size(dimX, dimY)
Redim _zone(dimX+1, dimY+1)
For i = 0 to Me.Dimensions.Width + 1
For j = 0 to Me.Dimensions.Height + 1
Zone(i,j) = new Zone(zoneType.wall)
Zone(i,j) = new Zone(zoneType.floor)
for i = 0 to Me.dimensions.Width + 1
zone(i,0) = new zone(zoneType.Wall)
zone(i,Me.dimensions.Height+1) = new zone(zoneType.Wall)
for i = 0 to Me.dimensions.Height + 1
zone(0,i) = new zone(zoneType.Wall)
zone(Me.dimensions.width+1, i) = new zone(zoneType.Wall)
"################################" &
"#...#.#...#..................###" &
"#.........#...................##" &
"#...#.#...#....................#" &
"#####.#####....................#" &
"#..............................." &
"#..............................." &
"#..............................#" &
"#..............................#" &
"#.............................##" &
"#............................###" &
"################################"
For i = 0 to Me.Dimensions.Width + 1
For j = 0 to Me.Dimensions.Height + 1
if lvl(i+j*32) = "#" then
Zone(i,j) = new Zone(zoneType.wall)
Zone(i,j) = new Zone(zoneType.floor)
public Property Type As zoneType
Public Property Elems As New List(of Entity)
Public sub New(type As zoneType)