NOTE: This is a very 'Odd' way of making a terrain generation system; It was my first go at it and I have learned a ton since the start.
What is it?
A some what random terrain generation system / tile engine.
What do you mean "Some what random"?
Well its not completely random. If it were then there would be grass 'blocks' in the middle of the ocean and water randomly flooding your island.
In the title it says '[Incomplete] whats the deal with that?
Well I started this mini project planning to finish it as a whole game, but I realise now that my main goal isnt possible with turing. It requires a quicker/more powerful language to keep up with all the crap I want to do with it. Since its incomplete it has a bug or two.
What are said bugs?
Well I didn't finish coding the map boundaries for 'Left' and 'up' so if you attempt to go far left or far up you will receive an error. I have fixed said error for down and right. It should be easy to fix. There is most likely another bug or two but I have yet to find it.
Screen shot please?
No, Not now at least. I'm lazy.
Download please?
No, you get to copy + paste it.
Turing: |
%===========================================================================%
% = == = == = == = == = == = Initial Setup = == = == = == = == = == = == = %
%===========================================================================%
import GUI
setscreen ("graphics:500;500,nobuttonbar,offscreenonly")
View.Set ("title:Realm Of The Mad God Clone")
var SpawnX : int := maxx div 2
var SpawnY : int := maxy div 2
var CharX : int := 100
var CharY : int := 0
var RowX : int := 0
var RowY : int := 0
var TileType : array 1 .. 625 of string
var TempColor : int := 0
var TempOdds : int := 0
var PHealth : int := 0
var chars : array char of boolean
var WorldX : int := 0
var WorldY : int := 0
for i : 1 .. 625
TileType (i ) := "Water"
end for
%===========================================================================%
% = == = == = == = == = == = GenerateWorld = == = == = == = == = == = == = %
%===========================================================================%
procedure GenerateWorld
for i : 1 .. 625
TempOdds := 0
if RowX > 24 then
RowX := 0
RowY := RowY + 1
end if
if RowX = 0 or RowX = 24 or RowY = 0 or RowY = 24 then
TileType (i ) := "Water"
else
if TileType (i - 1) = "Water" and TileType (i - 10) = "Water" then
TempOdds := TempOdds + 50 + Rand.Int (0, 50)
if TempOdds > 75 then
TileType (i ) := "Water"
end if
if TempOdds < 75 then
TileType (i ) := "Sand"
end if
end if
if TileType (i - 1) = "Sand" and TileType (i - 10) = "Water" then
TempOdds := TempOdds + 50 + Rand.Int (0, 50)
if TempOdds > 90 then
TileType (i ) := "Water"
end if
if TempOdds < 90 then
TileType (i ) := "Sand"
end if
end if
if TileType (i - 1) = "Water" and TileType (i - 10) = "Sand" then
TempOdds := TempOdds + 50 + Rand.Int (0, 50)
if TempOdds > 95 then
TileType (i ) := "Water"
end if
if TempOdds < 95 then
TileType (i ) := "Sand"
end if
end if
if TileType (i - 1) = "Sand" and TileType (i - 10) = "Sand" then
TempOdds := TempOdds + 50 + Rand.Int (0, 50)
if TempOdds > 95 then
TileType (i ) := "Water"
end if
if TempOdds < 95 then
TileType (i ) := "Sand"
end if
end if
end if
RowX := RowX + 1
end for
end GenerateWorld
%===========================================================================%
% = == = == = == = == = == = Draw World = == = == = == = == = == = == = %
%===========================================================================%
var MapInt : int := 1
var MapIntX : int := 0
var MapIntY : int := 0
proc DrawWorld
if MapIntY > - 1 then
if TileType (MapInt ) = "Sand" then
Draw.FillBox (0 * 50, 0 * 50, 0 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt ) = "Water" then
Draw.FillBox (0 * 50, 0 * 50, 0 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 1) = "Sand" then
Draw.FillBox (1 * 50, 0 * 50, 1 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 1) = "Water" then
Draw.FillBox (1 * 50, 0 * 50, 1 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 2) = "Sand" then
Draw.FillBox (2 * 50, 0 * 50, 2 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 2) = "Water" then
Draw.FillBox (2 * 50, 0 * 50, 2 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 3) = "Sand" then
Draw.FillBox (3 * 50, 0 * 50, 3 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 3) = "Water" then
Draw.FillBox (3 * 50, 0 * 50, 3 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 4) = "Sand" then
Draw.FillBox (4 * 50, 0 * 50, 4 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 4) = "Water" then
Draw.FillBox (4 * 50, 0 * 50, 4 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 5) = "Sand" then
Draw.FillBox (5 * 50, 0 * 50, 5 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 5) = "Water" then
Draw.FillBox (5 * 50, 0 * 50, 5 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 6) = "Sand" then
Draw.FillBox (6 * 50, 0 * 50, 6 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 6) = "Water" then
Draw.FillBox (6 * 50, 0 * 50, 6 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 7) = "Sand" then
Draw.FillBox (7 * 50, 0 * 50, 7 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 7) = "Water" then
Draw.FillBox (7 * 50, 0 * 50, 7 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 8) = "Sand" then
Draw.FillBox (8 * 50, 0 * 50, 8 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 8) = "Water" then
Draw.FillBox (8 * 50, 0 * 50, 8 * 50 + 50, 0 * 50 + 50, 100)
end if
if TileType (MapInt + 9) = "Sand" then
Draw.FillBox (9 * 50, 0 * 50, 9 * 50 + 50, 0 * 50 + 50, 14)
elsif TileType (MapInt + 9) = "Water" then
Draw.FillBox (9 * 50, 0 * 50, 9 * 50 + 50, 0 * 50 + 50, 100)
end if
end if
if MapIntY > - 2 then
if TileType (MapInt + 25) = "Sand" then
Draw.FillBox (0 * 50, 1 * 50, 0 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 25) = "Water" then
Draw.FillBox (0 * 50, 1 * 50, 0 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 26) = "Sand" then
Draw.FillBox (1 * 50, 1 * 50, 1 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 26) = "Water" then
Draw.FillBox (1 * 50, 1 * 50, 1 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 27) = "Sand" then
Draw.FillBox (2 * 50, 1 * 50, 2 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 27) = "Water" then
Draw.FillBox (2 * 50, 1 * 50, 2 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 28) = "Sand" then
Draw.FillBox (3 * 50, 1 * 50, 3 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 28) = "Water" then
Draw.FillBox (3 * 50, 1 * 50, 3 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 29) = "Sand" then
Draw.FillBox (4 * 50, 1 * 50, 4 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 29) = "Water" then
Draw.FillBox (4 * 50, 1 * 50, 4 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 30) = "Sand" then
Draw.FillBox (5 * 50, 1 * 50, 5 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 30) = "Water" then
Draw.FillBox (5 * 50, 1 * 50, 5 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 31) = "Sand" then
Draw.FillBox (6 * 50, 1 * 50, 6 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 31) = "Water" then
Draw.FillBox (6 * 50, 1 * 50, 6 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 32) = "Sand" then
Draw.FillBox (7 * 50, 1 * 50, 7 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 32) = "Water" then
Draw.FillBox (7 * 50, 1 * 50, 7 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 33) = "Sand" then
Draw.FillBox (8 * 50, 1 * 50, 8 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 33) = "Water" then
Draw.FillBox (8 * 50, 1 * 50, 8 * 50 + 50, 1 * 50 + 50, 100)
end if
if TileType (MapInt + 34) = "Sand" then
Draw.FillBox (9 * 50, 1 * 50, 9 * 50 + 50, 1 * 50 + 50, 14)
elsif TileType (MapInt + 34) = "Water" then
Draw.FillBox (9 * 50, 1 * 50, 9 * 50 + 50, 1 * 50 + 50, 100)
end if
end if
if MapIntY > - 3 then
if TileType (MapInt + 50) = "Sand" then
Draw.FillBox (0 * 50, 2 * 50, 0 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 50) = "Water" then
Draw.FillBox (0 * 50, 2 * 50, 0 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 51) = "Sand" then
Draw.FillBox (1 * 50, 2 * 50, 1 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 51) = "Water" then
Draw.FillBox (1 * 50, 2 * 50, 1 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 52) = "Sand" then
Draw.FillBox (2 * 50, 2 * 50, 2 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 52) = "Water" then
Draw.FillBox (2 * 50, 2 * 50, 2 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 53) = "Sand" then
Draw.FillBox (3 * 50, 2 * 50, 3 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 53) = "Water" then
Draw.FillBox (3 * 50, 2 * 50, 3 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 54) = "Sand" then
Draw.FillBox (4 * 50, 2 * 50, 4 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 54) = "Water" then
Draw.FillBox (4 * 50, 2 * 50, 4 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 55) = "Sand" then
Draw.FillBox (5 * 50, 2 * 50, 5 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 55) = "Water" then
Draw.FillBox (5 * 50, 2 * 50, 5 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 56) = "Sand" then
Draw.FillBox (6 * 50, 2 * 50, 6 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 56) = "Water" then
Draw.FillBox (6 * 50, 2 * 50, 6 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 57) = "Sand" then
Draw.FillBox (7 * 50, 2 * 50, 7 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 57) = "Water" then
Draw.FillBox (7 * 50, 2 * 50, 7 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 58) = "Sand" then
Draw.FillBox (8 * 50, 2 * 50, 8 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 58) = "Water" then
Draw.FillBox (8 * 50, 2 * 50, 8 * 50 + 50, 2 * 50 + 50, 100)
end if
if TileType (MapInt + 59) = "Sand" then
Draw.FillBox (9 * 50, 2 * 50, 9 * 50 + 50, 2 * 50 + 50, 14)
elsif TileType (MapInt + 59) = "Water" then
Draw.FillBox (9 * 50, 2 * 50, 9 * 50 + 50, 2 * 50 + 50, 100)
end if
end if
if MapIntY > - 3 then
if TileType (MapInt + 75) = "Sand" then
Draw.FillBox (0 * 50, 3 * 50, 0 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 74) = "Water" then
Draw.FillBox (0 * 50, 3 * 50, 0 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 76) = "Sand" then
Draw.FillBox (1 * 50, 3 * 50, 1 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 76) = "Water" then
Draw.FillBox (1 * 50, 3 * 50, 1 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 77) = "Sand" then
Draw.FillBox (2 * 50, 3 * 50, 2 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 77) = "Water" then
Draw.FillBox (2 * 50, 3 * 50, 2 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 78) = "Sand" then
Draw.FillBox (3 * 50, 3 * 50, 3 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 78) = "Water" then
Draw.FillBox (3 * 50, 3 * 50, 3 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 79) = "Sand" then
Draw.FillBox (4 * 50, 3 * 50, 4 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 79) = "Water" then
Draw.FillBox (4 * 50, 3 * 50, 4 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 80) = "Sand" then
Draw.FillBox (5 * 50, 3 * 50, 5 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 80) = "Water" then
Draw.FillBox (5 * 50, 3 * 50, 5 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 81) = "Sand" then
Draw.FillBox (6 * 50, 3 * 50, 6 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 81) = "Water" then
Draw.FillBox (6 * 50, 3 * 50, 6 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 82) = "Sand" then
Draw.FillBox (7 * 50, 3 * 50, 7 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 82) = "Water" then
Draw.FillBox (7 * 50, 3 * 50, 7 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 83) = "Sand" then
Draw.FillBox (8 * 50, 3 * 50, 8 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 83) = "Water" then
Draw.FillBox (8 * 50, 3 * 50, 8 * 50 + 50, 3 * 50 + 50, 100)
end if
if TileType (MapInt + 84) = "Sand" then
Draw.FillBox (9 * 50, 3 * 50, 9 * 50 + 50, 3 * 50 + 50, 14)
elsif TileType (MapInt + 84) = "Water" then
Draw.FillBox (9 * 50, 3 * 50, 9 * 50 + 50, 3 * 50 + 50, 100)
end if
end if
if TileType (MapInt + 100) = "Sand" then
Draw.FillBox (0 * 50, 4 * 50, 0 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 100) = "Water" then
Draw.FillBox (0 * 50, 4 * 50, 0 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 101) = "Sand" then
Draw.FillBox (1 * 50, 4 * 50, 1 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 101) = "Water" then
Draw.FillBox (1 * 50, 4 * 50, 1 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 102) = "Sand" then
Draw.FillBox (2 * 50, 4 * 50, 2 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 102) = "Water" then
Draw.FillBox (2 * 50, 4 * 50, 2 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 103) = "Sand" then
Draw.FillBox (3 * 50, 4 * 50, 3 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 103) = "Water" then
Draw.FillBox (3 * 50, 4 * 50, 3 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 104) = "Sand" then
Draw.FillBox (4 * 50, 4 * 50, 4 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 104) = "Water" then
Draw.FillBox (4 * 50, 4 * 50, 4 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 105) = "Sand" then
Draw.FillBox (5 * 50, 4 * 50, 5 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 105) = "Water" then
Draw.FillBox (5 * 50, 4 * 50, 5 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 106) = "Sand" then
Draw.FillBox (6 * 50, 4 * 50, 6 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 106) = "Water" then
Draw.FillBox (6 * 50, 4 * 50, 6 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 107) = "Sand" then
Draw.FillBox (7 * 50, 4 * 50, 7 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 107) = "Water" then
Draw.FillBox (7 * 50, 4 * 50, 7 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 108) = "Sand" then
Draw.FillBox (8 * 50, 4 * 50, 8 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 108) = "Water" then
Draw.FillBox (8 * 50, 4 * 50, 8 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 109) = "Sand" then
Draw.FillBox (9 * 50, 4 * 50, 9 * 50 + 50, 4 * 50 + 50, 14)
elsif TileType (MapInt + 109) = "Water" then
Draw.FillBox (9 * 50, 4 * 50, 9 * 50 + 50, 4 * 50 + 50, 100)
end if
if TileType (MapInt + 125) = "Sand" then
Draw.FillBox (0 * 50, 5 * 50, 0 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 125) = "Water" then
Draw.FillBox (0 * 50, 5 * 50, 0 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 126) = "Sand" then
Draw.FillBox (1 * 50, 5 * 50, 1 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 126) = "Water" then
Draw.FillBox (1 * 50, 5 * 50, 1 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 127) = "Sand" then
Draw.FillBox (2 * 50, 5 * 50, 2 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 127) = "Water" then
Draw.FillBox (2 * 50, 5 * 50, 2 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 128) = "Sand" then
Draw.FillBox (3 * 50, 5 * 50, 3 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 128) = "Water" then
Draw.FillBox (3 * 50, 5 * 50, 3 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 129) = "Sand" then
Draw.FillBox (4 * 50, 5 * 50, 4 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 129) = "Water" then
Draw.FillBox (4 * 50, 5 * 50, 4 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 130) = "Sand" then
Draw.FillBox (5 * 50, 5 * 50, 5 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 130) = "Water" then
Draw.FillBox (5 * 50, 5 * 50, 5 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 131) = "Sand" then
Draw.FillBox (6 * 50, 5 * 50, 6 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 131) = "Water" then
Draw.FillBox (6 * 50, 5 * 50, 6 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 132) = "Sand" then
Draw.FillBox (7 * 50, 5 * 50, 7 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 132) = "Water" then
Draw.FillBox (7 * 50, 5 * 50, 7 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 133) = "Sand" then
Draw.FillBox (8 * 50, 5 * 50, 8 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 133) = "Water" then
Draw.FillBox (8 * 50, 5 * 50, 8 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 134) = "Sand" then
Draw.FillBox (9 * 50, 5 * 50, 9 * 50 + 50, 5 * 50 + 50, 14)
elsif TileType (MapInt + 134) = "Water" then
Draw.FillBox (9 * 50, 5 * 50, 9 * 50 + 50, 5 * 50 + 50, 100)
end if
if TileType (MapInt + 150) = "Sand" then
Draw.FillBox (0 * 50, 6 * 50, 0 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 150) = "Water" then
Draw.FillBox (0 * 50, 6 * 50, 0 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 151) = "Sand" then
Draw.FillBox (1 * 50, 6 * 50, 1 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 151) = "Water" then
Draw.FillBox (1 * 50, 6 * 50, 1 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 152) = "Sand" then
Draw.FillBox (2 * 50, 6 * 50, 2 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 152) = "Water" then
Draw.FillBox (2 * 50, 6 * 50, 2 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 153) = "Sand" then
Draw.FillBox (3 * 50, 6 * 50, 3 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 153) = "Water" then
Draw.FillBox (3 * 50, 6 * 50, 3 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 154) = "Sand" then
Draw.FillBox (4 * 50, 6 * 50, 4 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 154) = "Water" then
Draw.FillBox (4 * 50, 6 * 50, 4 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 155) = "Sand" then
Draw.FillBox (5 * 50, 6 * 50, 5 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 155) = "Water" then
Draw.FillBox (5 * 50, 6 * 50, 5 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 156) = "Sand" then
Draw.FillBox (6 * 50, 6 * 50, 6 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 151) = "Water" then
Draw.FillBox (6 * 50, 6 * 50, 6 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 157) = "Sand" then
Draw.FillBox (7 * 50, 6 * 50, 7 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 151) = "Water" then
Draw.FillBox (7 * 50, 6 * 50, 7 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 158) = "Sand" then
Draw.FillBox (8 * 50, 6 * 50, 8 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 151) = "Water" then
Draw.FillBox (8 * 50, 6 * 50, 8 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 159) = "Sand" then
Draw.FillBox (9 * 50, 6 * 50, 9 * 50 + 50, 6 * 50 + 50, 14)
elsif TileType (MapInt + 151) = "Water" then
Draw.FillBox (9 * 50, 6 * 50, 9 * 50 + 50, 6 * 50 + 50, 100)
end if
if TileType (MapInt + 175) = "Sand" then
Draw.FillBox (0 * 50, 7 * 50, 0 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 175) = "Water" then
Draw.FillBox (0 * 50, 7 * 50, 0 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 176) = "Sand" then
Draw.FillBox (1 * 50, 7 * 50, 1 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 176) = "Water" then
Draw.FillBox (1 * 50, 7 * 50, 1 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 177) = "Sand" then
Draw.FillBox (2 * 50, 7 * 50, 2 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 177) = "Water" then
Draw.FillBox (2 * 50, 7 * 50, 2 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 178) = "Sand" then
Draw.FillBox (3 * 50, 7 * 50, 3 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 178) = "Water" then
Draw.FillBox (3 * 50, 7 * 50, 3 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 179) = "Sand" then
Draw.FillBox (4 * 50, 7 * 50, 4 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 179) = "Water" then
Draw.FillBox (4 * 50, 7 * 50, 4 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 180) = "Sand" then
Draw.FillBox (5 * 50, 7 * 50, 5 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 180) = "Water" then
Draw.FillBox (5 * 50, 7 * 50, 5 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 181) = "Sand" then
Draw.FillBox (6 * 50, 7 * 50, 6 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 181) = "Water" then
Draw.FillBox (6 * 50, 7 * 50, 6 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 182) = "Sand" then
Draw.FillBox (7 * 50, 7 * 50, 7 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 182) = "Water" then
Draw.FillBox (7 * 50, 7 * 50, 7 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 183) = "Sand" then
Draw.FillBox (8 * 50, 7 * 50, 8 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 183) = "Water" then
Draw.FillBox (8 * 50, 7 * 50, 8 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 184) = "Sand" then
Draw.FillBox (9 * 50, 7 * 50, 9 * 50 + 50, 7 * 50 + 50, 14)
elsif TileType (MapInt + 184) = "Water" then
Draw.FillBox (9 * 50, 7 * 50, 9 * 50 + 50, 7 * 50 + 50, 100)
end if
if TileType (MapInt + 200) = "Sand" then
Draw.FillBox (0 * 50, 8 * 50, 0 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 200) = "Water" then
Draw.FillBox (0 * 50, 8 * 50, 0 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 201) = "Sand" then
Draw.FillBox (1 * 50, 8 * 50, 1 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 201) = "Water" then
Draw.FillBox (1 * 50, 8 * 50, 1 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 202) = "Sand" then
Draw.FillBox (2 * 50, 8 * 50, 2 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 202) = "Water" then
Draw.FillBox (2 * 50, 8 * 50, 2 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 203) = "Sand" then
Draw.FillBox (3 * 50, 8 * 50, 3 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 203) = "Water" then
Draw.FillBox (3 * 50, 8 * 50, 3 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 204) = "Sand" then
Draw.FillBox (4 * 50, 8 * 50, 4 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 204) = "Water" then
Draw.FillBox (4 * 50, 8 * 50, 4 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 205) = "Sand" then
Draw.FillBox (5 * 50, 8 * 50, 5 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 205) = "Water" then
Draw.FillBox (5 * 50, 8 * 50, 5 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 206) = "Sand" then
Draw.FillBox (6 * 50, 8 * 50, 6 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 206) = "Water" then
Draw.FillBox (6 * 50, 8 * 50, 6 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 207) = "Sand" then
Draw.FillBox (7 * 50, 8 * 50, 7 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 207) = "Water" then
Draw.FillBox (7 * 50, 8 * 50, 7 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 208) = "Sand" then
Draw.FillBox (8 * 50, 8 * 50, 8 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 208) = "Water" then
Draw.FillBox (8 * 50, 8 * 50, 8 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 209) = "Sand" then
Draw.FillBox (9 * 50, 8 * 50, 9 * 50 + 50, 8 * 50 + 50, 14)
elsif TileType (MapInt + 209) = "Water" then
Draw.FillBox (9 * 50, 8 * 50, 9 * 50 + 50, 8 * 50 + 50, 100)
end if
if TileType (MapInt + 225) = "Sand" then
Draw.FillBox (0 * 50, 9 * 50, 0 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 225) = "Water" then
Draw.FillBox (0 * 50, 9 * 50, 0 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 226) = "Sand" then
Draw.FillBox (1 * 50, 9 * 50, 1 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 226) = "Water" then
Draw.FillBox (1 * 50, 9 * 50, 1 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 227) = "Sand" then
Draw.FillBox (2 * 50, 9 * 50, 2 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 227) = "Water" then
Draw.FillBox (2 * 50, 9 * 50, 2 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 228) = "Sand" then
Draw.FillBox (3 * 50, 9 * 50, 3 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 228) = "Water" then
Draw.FillBox (3 * 50, 9 * 50, 3 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 229) = "Sand" then
Draw.FillBox (4 * 50, 9 * 50, 4 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 229) = "Water" then
Draw.FillBox (4 * 50, 9 * 50, 4 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 230) = "Sand" then
Draw.FillBox (5 * 50, 9 * 50, 5 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 230) = "Water" then
Draw.FillBox (5 * 50, 9 * 50, 5 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 231) = "Sand" then
Draw.FillBox (6 * 50, 9 * 50, 6 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 231) = "Water" then
Draw.FillBox (6 * 50, 9 * 50, 6 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 232) = "Sand" then
Draw.FillBox (7 * 50, 9 * 50, 7 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 232) = "Water" then
Draw.FillBox (7 * 50, 9 * 50, 7 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 233) = "Sand" then
Draw.FillBox (8 * 50, 9 * 50, 8 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 233) = "Water" then
Draw.FillBox (8 * 50, 9 * 50, 8 * 50 + 50, 9 * 50 + 50, 100)
end if
if TileType (MapInt + 234) = "Sand" then
Draw.FillBox (9 * 50, 9 * 50, 9 * 50 + 50, 9 * 50 + 50, 14)
elsif TileType (MapInt + 234) = "Water" then
Draw.FillBox (9 * 50, 9 * 50, 9 * 50 + 50, 9 * 50 + 50, 100)
end if
Draw.FillBox (CharX, CharY, CharX + 50, CharY + 50, red)
if MapIntX > 16 then
Draw.FillBox (CharX + 100, 0, maxx, maxy, 100 )
end if
end DrawWorld
%===========================================================================%
% = == = == = == = == = == = PlayerSpawn = == = == = == = == = == = == = %
%===========================================================================%
proc PlayerSpawn
PHealth := 100
CharX := SpawnX
CharY := SpawnY
end PlayerSpawn
%===========================================================================%
% = == = == = == = == = == = PlayerSpawn = == = == = == = == = == = == = %
%===========================================================================%
proc KeyDown
Input.KeyDown (chars )
if chars ('w') or chars (KEY_UP_ARROW) then
MapInt := MapInt + 25
MapIntY := MapIntY + 1
end if
if chars ('a') or chars (KEY_LEFT_ARROW) then
MapInt := MapInt - 1
MapIntX := MapIntX - 1
end if
if chars ('s') and MapIntY > - 4 or chars (KEY_DOWN_ARROW) then
MapInt := MapInt - 25
MapIntY := MapIntY - 1
end if
if chars ('d') and MapIntX < 18 or chars (KEY_RIGHT_ARROW) then
MapInt := MapInt + 1
MapIntX := MapIntX + 1
end if
end KeyDown
%===========================================================================%
% = == = == = == = == = == = Game Loop = == = == = == = == = == = == = %
%===========================================================================%
GenerateWorld
loop
GUI.SetBackgroundColour (100)
if PHealth < 100 then
PlayerSpawn
end if
KeyDown
DrawWorld
View.Update
delay (100)
cls
end loop
|
What in the mother of god is this crap you suck!
Shut up troll.
Wow thats messy.
I know, As I said this was my first "big" project and I wrote most of it on the fly. Its very inefficient. |