ok im doing a snakes and ladders game and i dont know how to make dice and i dont know how to make it so when you land on a green square you go up to the next square this is what i have i know its bad but please help today!!! if you want you can add me on msn seanagahon@hotmail.com or e-mail me at the adress
var ft, snake : int
var n : string
var ladder : int
var menu : int
var options : int
options := Pic.FileNew ("menuoptions.jpg")
menu := Pic.FileNew ("menu.jpg")
ladder := Pic.FileNew ("ladder.jpg")
snake := Pic.FileNew ("snake.jpg")
var userinput : int
var ft1 : int
ft1 := Font.New ("chiller:16")
var ur, e : string (1)
proc quitscreen
Draw.Cls
Draw.FillBox (0, 0, 1000, 1000, brightgreen)
Draw.Text ("I guess you dont want to play my sweet game =(", 0, 350, ft1, 112)
Draw.Text ("Have Fun And Come Back Again =)", 0, 330, ft1, 112)
Draw.Text ("Press enter to return to menu", 0, 310, ft1, 112)
end quitscreen
proc titlescreen
Draw.FillBox (0, 0, 1000, 1000, brightgreen)
var x, y : int
var title : string
title := "Snakes And Ladders"
x := 150
y := 350
ft := Font.New ("harrington:30")
for j : 1 .. length (title)
for k : 1 .. 8
Draw.Text (title (j), x, y, ft, 13)
delay (100)
exit when y < 220
Draw.FillBox (x, y, x + 32, y + 32, brightgreen)
y := y - 20
end for
x := x + 20
y := 350
end for
end titlescreen
proc intstructions
Draw.FillBox (0, 0, 1000, 1000, 41)
Draw.Text ("Use The <-- and --> up arrow keys to move your peice after the dice rolls.", 0, 340, ft1, brightgreen)
Draw.Text ("Only move the peice the number that the dice shows.", 0, 280, ft1, brightgreen)
Draw.Text ("The objective for this game is to reach the top of the board.", 0, 300, ft1, brightgreen)
Draw.Text ("The green squares make you go up and the red ones make you go down", 0, 320, ft1, brightgreen)
Draw.Text ("This is only a two player game (both human players), Press enter when Done Moveing", 0, 360, ft1, brightgreen)
Draw.Text ("Press enter when your turn is complete..........", 0, 260, ft1, brightgreen)
end intstructions
proc piece (x, y, clr1, clr2 : int)
Draw.FillOval (x, y, 20, 20, clr1)
Draw.FillStar (x - 17, y - 15, x + 20, y + 20, clr2)
end piece
proc piece2 (x, y, clr1, clr2 : int)
Draw.FillOval (x, y, 20, 20, clr1)
Draw.FillStar (x - 17, y - 15, x + 20, y + 20, clr2)
end piece2
proc names
Draw.Text ("Type in player ones name: ", 150, 300, ft1, blue)
get n : *
Draw.FillBox (0, 400, 360, 360, white)
Draw.Text (" Hello " + n, 320, 300, ft1, 43)
var f : string
var ft2 : int
ft2 := Font.New ("tremor:16")
Draw.Text ("Type in player twos name: ", 150, 150, ft2, blue)
get f : *
Draw.FillBox (0, 400, 360, 320, white)
Draw.Text (" Hello " + f, 395, 150, ft2, 13)
end names
proc gameboard
var x, x2, y2, y : int
x := 90
y := 360
for j : 1 .. 85
Draw.FillBox (x, y, x + 40, y + 40, red)
Draw.Box (x, y, x + 40, y + 40, yellow)
x := x + 40
if x >= 510 then
y := y - 40
x := 90
end if
Draw.FillBox (x, y, x + 40, y + 40, black)
Draw.Box (x, y, x + 40, y + 40, yellow)
x := x + 40
if x >= 510 then
y := y - 40
x := 90
end if
end for
%Red Squares (down)
Draw.Fill (100, 440, brightred, yellow)
Draw.Fill (140, 100, brightred, yellow)
Draw.Fill (180, 140, brightred, yellow)
Draw.Fill (220, 180, brightred, yellow)
Draw.Fill (260, 220, brightred, yellow)
%Green Squares (up)
Draw.Fill (140, 20, brightgreen, yellow)
Draw.Fill (500, 140, brightgreen, yellow)
Draw.Fill (220, 300, brightgreen, yellow)
Draw.Fill (260, 50, brightgreen, yellow)
Draw.Fill (300, 150, brightgreen, yellow)
end gameboard
proc winscreen
Draw.FillBox (0, 0, 1000, 1000, 13)
var x, y, x1, y2 : int
ft := Font.New ("Jokerman:40")
Draw.Text ("Omfg0rz you won!!!", 50, 20, ft, red)
x := 20
y := 300
for j : 1 .. 12
Pic.Draw (snake, x, y, picCopy)
x := x + 100
if x >= 600 then
y := y - 188
x := 20
end if
end for
y2 := 200
x1 := 0
for k : 1 .. 8
Pic.Draw (ladder, x1, y2, picCopy)
x1 := x1 + 81
end for
end winscreen
proc gameplay
loop
var x, y, clr : int
var ky : string (1)
gameboard
%Player 1 move his/her piece across up and down
x := 110
y := 20
loop
gameboard
piece (x, y, green, yellow)
getch (ky)
piece (x, y, white, white) %Erase the piece
exit when ord (ky) = 10
if ord (ky) = 205 then
x := x + 40
elsif ord (ky) = 203 then
x := x - 40
elsif ord (ky) = 200 then
y := y + 40
elsif ord (ky) = 208 then
y := y - 40
end if
end loop
%Player 2 moves left and right up and down
x := 110
y := 20
loop
gameboard
piece (x, y, blue, red)
getch (ky)
piece (x, y, white, white) %Erase the piece
exit when ord (ky) = 10
if ord (ky) = 205 then
x := x + 40
elsif ord (ky) = 203 then
x := x - 40
elsif ord (ky) = 200 then
y := y + 40
elsif ord (ky) = 200 then
y := y - 40
end if
end loop
end loop
end gameplay
proc menu1
var ft3 : int
ft3 := Font.New ("Harrington:25")
Pic.Draw (menu, 100, 50, 0)
Pic.Draw (options, 200, 70, 0)
View.Set ("nocursor")
Draw.Text ("Extreme Snakes And Freaking Ladders!!!!", 25, 350, ft3, 41)
getch (ur)
loop
if ord (ur) = 49 then
Draw.Cls
intstructions %(instructions)
getch (ur)
exit when hasch
Draw.Cls
menu1
elsif ord (ur) = 50 then
Draw.Cls
gameplay %(the game)
elsif ord (ur) = 51 then
quitscreen %(decided not to play)
getch (ur)
if ord (ur) = 10 then
exit when hasch
Draw.Cls
menu1
end if
%else ord (ur) = then
%Draw.FillBox (0, 0, 640, 400, black)
end if
end loop
end menu1
loop
menu1
end loop
Archived topic from Iceteks, old topic ID:4384, old post ID:35321
TURING HELP URGENT!!
Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Return to “Computer Hardware and Software”
Jump to
- Forum Information & Help
- ↳ Register / Manage Account
- ↳ Forum Announcements
- ↳ Forum Help and Feedback
- General
- ↳ General Discussion
- ↳ Politics, Debates and Heated Discussions
- Technology (Formally Iceteks Forum)
- ↳ General Technology
- ↳ Networking and Security
- ↳ Computer Hardware and Software
- ↳ Mobile Computers and Small Devices
- ↳ Programming
- ↳ Photography and Digital arts
- UO Gateway (Official Forum)
- ↳ www.uogateway.com
- ↳ UO Gateway Announcements
- ↳ General UO Gateway Discussion and Support
- ↳ Shard Discussion
- ↳ Shard Administration
- Age of Valor Free Shard (defunct)
- ↳ Age of Valor Annoucements
- ↳ Patch Notes and Upcomming Content
- ↳ Events
- ↳ General Age of Valor Discussion
- ↳ Guilds/Factions
- ↳ Gauntlet Mall
- ↳ Suggestions and Bug Reports