Turing --Help
2 posters
Page 1 of 1
Turing --Help
A simple programming language, easy to use, and learn, that I've basically mastered (Java's a bitch anyways ).
Download from here (it's free) if you want it:
http://www.holtsoft.com/
I'll use this as a help thread.
Download from here (it's free) if you want it:
http://www.holtsoft.com/
I'll use this as a help thread.
Onyx- Administrator
- Number of posts : 403
Registration date : 2007-11-09
G.W. Stats
Gangsta Name: Pimp Slap Sr.
Gang:
Turing Cannonball Game
I am creating a game called CannonChuck!!
But... i need a little help on the final stages of production.
Here is the code that i got so far:
View.Set ("graphics:900;400,nobuttonbar") %frame manipulation
var pic : int := Pic.FileNew ("chucknorris3.jpg")
var pic2 : int := Pic.FileNew ("the world trade center.jpg")
var pic3 : int := Pic.FileNew ("wtc1.jpg")
var pic4 : int := Pic.FileNew ("world_trade_centre.jpg")
var font1 : int
var key : string (1)
var velocity, theta : real := 0
var x, y : int := 0
var timer : real := 0
var gravity : real := 1 %GRAVITY
var counter : int := 0
%draws Chuck
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%Title
font1 := Font.New ("Palatino:50:bold,italic")
assert font1 > 0
Font.Draw ("CannonChuck Game", 50, 290, font1, 12)
Font.Free (font1)
locatexy (300, 230)
put "Press any key to continue" ..
getch (key)
cls
%instructions
put ""
put ""
put "Hit the top of the World Trade Center with Chuck Norris to destroy it. Once the World Trade Center has been hit"
put "at the right spot by Chuck Norris, it will explode and sink to the ground. To shoot Chuck Norris, type in low"
put "digit integers for the initial power and angle of deployment."
put ""
put "Press any key to continue" ..
getch (key)
cls
loop
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%angle and power
locatexy (0, 390)
put "Enter an initial power (1 to 30): " ..
get velocity
locatexy (0, 390)
drawfillbox (0, 380, 200, 400, 0)
put "Enter an angle of deployment (0 to 90): " ..
get theta
loop
setscreen ("offscreenonly")
Pic.Draw (pic, x, y, picMerge)
delay (100)
cls
Pic.Draw (pic2, 635, 0, picCopy)
Pic.Draw (pic, x, y, picMerge)
View.Update
x := round (x + velocity * timer * cosd (theta))
y := round (y + velocity * timer * sind (theta) - 0.5 * gravity * timer * timer)
timer := timer + 0.1
View.Update
exit when x >= 900
if x >= 700 and y >= 250 and y <= 350 then
cls
end if
end loop
end loop
i just cannot get the program to rerun and my if statements don't seem to work.
But... i need a little help on the final stages of production.
Here is the code that i got so far:
View.Set ("graphics:900;400,nobuttonbar") %frame manipulation
var pic : int := Pic.FileNew ("chucknorris3.jpg")
var pic2 : int := Pic.FileNew ("the world trade center.jpg")
var pic3 : int := Pic.FileNew ("wtc1.jpg")
var pic4 : int := Pic.FileNew ("world_trade_centre.jpg")
var font1 : int
var key : string (1)
var velocity, theta : real := 0
var x, y : int := 0
var timer : real := 0
var gravity : real := 1 %GRAVITY
var counter : int := 0
%draws Chuck
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%Title
font1 := Font.New ("Palatino:50:bold,italic")
assert font1 > 0
Font.Draw ("CannonChuck Game", 50, 290, font1, 12)
Font.Free (font1)
locatexy (300, 230)
put "Press any key to continue" ..
getch (key)
cls
%instructions
put ""
put ""
put "Hit the top of the World Trade Center with Chuck Norris to destroy it. Once the World Trade Center has been hit"
put "at the right spot by Chuck Norris, it will explode and sink to the ground. To shoot Chuck Norris, type in low"
put "digit integers for the initial power and angle of deployment."
put ""
put "Press any key to continue" ..
getch (key)
cls
loop
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%angle and power
locatexy (0, 390)
put "Enter an initial power (1 to 30): " ..
get velocity
locatexy (0, 390)
drawfillbox (0, 380, 200, 400, 0)
put "Enter an angle of deployment (0 to 90): " ..
get theta
loop
setscreen ("offscreenonly")
Pic.Draw (pic, x, y, picMerge)
delay (100)
cls
Pic.Draw (pic2, 635, 0, picCopy)
Pic.Draw (pic, x, y, picMerge)
View.Update
x := round (x + velocity * timer * cosd (theta))
y := round (y + velocity * timer * sind (theta) - 0.5 * gravity * timer * timer)
timer := timer + 0.1
View.Update
exit when x >= 900
if x >= 700 and y >= 250 and y <= 350 then
cls
end if
end loop
end loop
i just cannot get the program to rerun and my if statements don't seem to work.
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
woo man, all my stuff is going all over the place an for a second, i couldn't find it.
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
There. After you used the Setscreen command, you exit the game to restart right? Well you needed to put the View.Update after you askt eh user for your Power/Angle again. I also threw in a CLS when you exit the loop (to clear everything), and I also made it so the x,y, and timer variables reset after entering the loop again. This was the thing screwing you up. You had "exit when x>900. After the first shot, X would still be over 900 unless you make it =0 again.
- Code:
View.Set ("graphics:900;400,nobuttonbar") %frame manipulation
var pic : int := Pic.FileNew ("chucknorris3.jpg")
var pic2 : int := Pic.FileNew ("the world trade center.jpg")
var pic3 : int := Pic.FileNew ("wtc1.jpg")
var pic4 : int := Pic.FileNew ("world_trade_centre.jpg")
var font1 : int
var key : string (1)
var velocity, theta : real := 0
var x, y : int := 0
var timer : real := 0
var gravity : real := 1 %GRAVITY
var counter : int := 0
%draws Chuck
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%Title
font1 := Font.New ("Palatino:50:bold,italic")
assert font1 > 0
Font.Draw ("CannonChuck Game", 50, 290, font1, 12)
Font.Free (font1)
locatexy (300, 230)
put "Press any key to continue" ..
getch (key)
cls
%instructions
put ""
put ""
put "Hit the top of the World Trade Center with Chuck Norris to destroy it. Once the World Trade Center has been hit"
put "at the right spot by Chuck Norris, it will explode and sink to the ground. To shoot Chuck Norris, type in low"
put "digit integers for the initial power and angle of deployment."
put ""
put "Press any key to continue" ..
getch (key)
cls
loop
x:=0 %new code
y:=0 %new code
timer:=0 %new code
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%angle and power
locatexy (0, 390)
put "Enter an initial power (1 to 30): " ..
View.Update %new code
get velocity
locatexy (0, 390)
drawfillbox (0, 380, 200, 400, 0)
put "Enter an angle of deployment (0 to 90): " ..
View.Update %new code
get theta
loop
setscreen ("offscreenonly")
Pic.Draw (pic, x, y, picMerge)
delay (100)
cls
Pic.Draw (pic2, 635, 0, picCopy)
Pic.Draw (pic, x, y, picMerge)
View.Update
x := round (x + velocity * timer * cosd (theta))
y := round (y + velocity * timer * sind (theta) - 0.5 * gravity * timer * timer)
timer := timer + 0.1
View.Update
exit when x >= 900
exit when y<0 %new code
if x >= 700 and y >= 250 and y <= 350 then
cls
end if
end loop
cls %new code
end loop
Yea well you put it in the talk thread, after I made the Turing help thread soo....woo man, all my stuff is going all over the place an for a second, i couldn't find it.
Onyx- Administrator
- Number of posts : 403
Registration date : 2007-11-09
G.W. Stats
Gangsta Name: Pimp Slap Sr.
Gang:
Re: Turing --Help
It works like a charm now. When i went to post again in yours site, the thread still showed above what i am writing here. I don't know if that is an bug or not in your site. Just so you know. I don't know about the actual physics still because it still seems like it is going straight and not on an arc.
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
^ nah, that's just so you don't forgot what the last couple people said
Onyx- Administrator
- Number of posts : 403
Registration date : 2007-11-09
G.W. Stats
Gangsta Name: Pimp Slap Sr.
Gang:
Re: Turing --Help
what the other people said ends up on top of what i am writing in the the reply box
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
Here is the program finished to hand-in standards
- Code:
View.Set ("graphics:900;400,nobuttonbar") %frame manipulation
var pic : int := Pic.FileNew ("chucknorris3.jpg")
var pic2 : int := Pic.FileNew ("the world trade center.jpg")
var pic3 : int := Pic.FileNew ("wtc1.jpg")
var pic4 : int := Pic.FileNew ("world_trade_centre.jpg")
var font1 : int
var key : string (1)
var key1 : string (1)
var velocity, theta : real := 0
var x, y : int := 0
var timer : real := 0
var gravity : real := 1 %GRAVITY
var counter : int := 0
%draws Chuck
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%Title
font1 := Font.New ("Palatino:50:bold,italic")
assert font1 > 0
Font.Draw ("CannonChuck Game", 50, 290, font1, 12)
Font.Free (font1)
locatexy (300, 230)
put "Press any key to continue" ..
getch (key)
cls
%instructions
put ""
put ""
put "Hit the top of the World Trade Center with Chuck Norris to destroy it. Once the World Trade Center has been hit"
put "at the right spot by Chuck Norris, it will explode and sink to the ground. To shoot Chuck Norris, type in low"
put "digit integers for the initial power and angle of deployment."
put ""
put "Press any key to continue" ..
getch (key)
cls
loop
x := 0
y := 0
timer := 0
counter := 0
cls
Pic.Draw (pic, 0, 0, picMerge)
%World Trade Center
Pic.Draw (pic2, 635, 0, picCopy)
%angle and power
loop
drawfillbox (0, 380, 400, 400, white)
locatexy (0, 390)
put "Enter an initial power (1 to 30): " ..
View.Update
get velocity
locatexy (0, 390)
drawfillbox (0, 380, 200, 400, 0)
put "Enter an angle of deployment (0 to 90): " ..
View.Update
get theta
exit when velocity <= 30 and theta <= 90
end loop
loop
setscreen ("offscreenonly")
Pic.Draw (pic, x, y, picMerge)
delay (100)
cls
Pic.Draw (pic2, 635, 0, picCopy)
Pic.Draw (pic, x, y, picMerge)
View.Update
x := round (x + velocity * timer * cosd (theta))
y := round (y + velocity * timer * sind (theta) - 0.5 * gravity * timer * timer)
timer := timer + 0.2
View.Update
exit when x >= 900
exit when y < 0
if x >= 700 and y >= 250 and y <= 350 then
counter := counter + 1
end if
end loop
cls
View.Update
if counter = 1 then
put "You knocked down the World Trade Center with the swift blow of Chuck Norris!!"
put "Would you like to play again?"
elsif counter = 0 then
put "You and Chuck are not buddies, shame on you."
put "Would you like to play again?"
end if
put "Y or N: " ..
View.Update
get key1
exit when key1 = "n" or key1 = "N"
end loop
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
Cool.
To upload pictures this site has a really cool feature.
Simply click the "Host an Image" Button (Picture with a floppy disc in front of it) as you are typing your post, and you can automatically upload them.
You can also upload pictures by getting a photobucket account, ect.
To upload pictures this site has a really cool feature.
Simply click the "Host an Image" Button (Picture with a floppy disc in front of it) as you are typing your post, and you can automatically upload them.
You can also upload pictures by getting a photobucket account, ect.
Onyx- Administrator
- Number of posts : 403
Registration date : 2007-11-09
G.W. Stats
Gangsta Name: Pimp Slap Sr.
Gang:
Re: Turing --Help
I wanted to upload the picture file so you could try out my game. By the way, your help really helped me out a lot.
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
*Cracks knuckles, neck, leg, toes, and elbow bones*
yep all in a day\'s work.
As for the pictures, just upload em like I said.
It\'s easy
looool, check this out.
I made this today...
Save this picture in the same spot as the game.
Oh, and if you want a good challenge, simply go to this section:
scabecount := 1
View.Set (\"offscreenonly\")
setscreen (\"graphics:780;500,nobuttonbar\")
change the scabecount to.. say 100. Have fun.
----------
Also I just discovered the whole upload picture from this site doesn't work...
Just go to www.photobucket.com
Register there (it's free), and upload pictures. Then once the pic is uploaded, copy and past the [img] code, and paste it into your post.
yep all in a day\'s work.
As for the pictures, just upload em like I said.
It\'s easy
looool, check this out.
I made this today...
- Code:
%Scabies 3.0
%Fixed '/' Glitch
var scabecount : int := 9999
var scabex, scabey : array 1 .. scabecount of int
var keys : array char of boolean
var picId : int %Variable for Picture
var scabespeed : int := 1
var handx, handy : int := 100
var hp : int := 198
var smallhp : real := 100
var tim : int := 0
var timecounter : int := 0
var sf1, sf2, sf3, sf4, sf5 : int := 0
var startingscabes : int
for a : 1 .. 9999
randint (scabex (a), 0, 700)
randint (scabey (a), 0, 500)
% randint (angle (a), 0,359)
% randint (dir (a) ,0,1)
% if dir(a) = 0 then
% dir (a) :=-1
% end if
end for
put "Type in the amount of scabes you would like to put into the atmosphere"
put "1-9999"
put""
put""
get startingscabes
scabecount := startingscabes
View.Set ("offscreenonly")
setscreen ("graphics:780;500,nobuttonbar")
loop
cls
picId := Pic.FileNew ("hand.bmp") %Pic must be in the same Folder as the Program
Pic.Draw (picId, handx, handy, picMerge) %X,and Y position of pic
Pic.Free (picId)
for x : 1 .. scabecount
drawfilloval (scabex (x), scabey (x), 2, 2, 4)
end for
locatexy (10, 10)
timecounter := timecounter + 1
put "Time survived: ", tim ..
if timecounter = 100 then
tim := tim + 1
timecounter := 0
end if
Input.KeyDown (keys)
if handx > 0 then
if keys (KEY_LEFT_ARROW) then
handx := handx - 2
end if
end if
if handx + 100 < 780 then
if keys (KEY_RIGHT_ARROW) then
handx := handx + 2
end if
end if
if handy + 100 < 500 then
if keys (KEY_UP_ARROW) then
handy := handy + 2
end if
end if
if handy > 0 then
if keys (KEY_DOWN_ARROW) then
handy := handy - 2
end if
end if
drawbox (500, 50, 700, 70, 255)
drawfillbox (501, 51, 501 + hp, 69, 10)
View.Update
if tim > 4 and (tim mod 5) = 0 then
if sf5 = 0 then
if scabecount < 9999 then
scabecount := scabecount + 1
end if
for xxx : 1 .. scabecount
randint (scabex (xxx), 0, 700)
randint (scabey (xxx), 0, 500)
end for
sf5 := 1
end if
end if
if tim > 4 and (tim mod 5) >= 1 then
sf5 := 0
end if
for b : 1 .. scabecount
if scabex (b) > handx + 50 then
scabex (b) := scabex (b) - scabespeed
elsif scabex (b) < handx + 50 then
scabex (b) := scabex (b) + scabespeed
end if
if scabey (b) > handy + 50 then
scabey (b) := scabey (b) - scabespeed
elsif scabey (b) < handy + 50 then
scabey (b) := scabey (b) + scabespeed
end if
end for
for c : 1 .. scabecount
if scabex (c) >= handx + 20 and scabex (c) <= handx + 80 and scabey (c) >= handy + 20 and scabey (c) <= handy + 80 then
smallhp := smallhp - 10
end if
end for
if smallhp < 0 then
hp := hp - 1
smallhp := 100
end if
exit when hp<0
end loop
cls
var font1 : int
font1 := Font.New ("Times New Roman:60")
assert font1 > 0
Font.Draw ("You got Teh Scabes!", 50, 250, font1, 255)
Font.Free (font1)
locatexy (250,10)
put "There were ",scabecount, " Scabes on Screen"
View.Update
Save this picture in the same spot as the game.
Oh, and if you want a good challenge, simply go to this section:
scabecount := 1
View.Set (\"offscreenonly\")
setscreen (\"graphics:780;500,nobuttonbar\")
change the scabecount to.. say 100. Have fun.
----------
Also I just discovered the whole upload picture from this site doesn't work...
Just go to www.photobucket.com
Register there (it's free), and upload pictures. Then once the pic is uploaded, copy and past the [img] code, and paste it into your post.
Last edited by Onyx on Thu Mar 20, 2008 12:44 pm; edited 3 times in total
Onyx- Administrator
- Number of posts : 403
Registration date : 2007-11-09
G.W. Stats
Gangsta Name: Pimp Slap Sr.
Gang:
Re: Turing --Help
How do i get a photobucket account? Also when go to upload picture it gives three options, thumbnail, image or image url. It has a url under each and a copy button beside each and an upload link on the bottom. Am i supposed to decide then click copy then click upload?
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
I got illegal character '\'
bolded was error
scabecount := 1
View.Set (\"offscreenonly\")
setscreen (\"graphics:780;500,nobuttonbar\")
loop
cls
picId := Pic.FileNew (\"hand.bmp\") %Pic must be in the same Folder as the Program
Pic.Draw (picId, handx, handy, picMerge) %X,and Y position of pic
Pic.Free (picId)
for x : 1 .. scabecount
drawfilloval (scabex (x), scabey (x), 2, 2, 4)
end for
locatexy (10, 10)
timecounter := timecounter + 1
put \"Time survived: \", tim ..
bolded was error
scabecount := 1
View.Set (\"offscreenonly\")
setscreen (\"graphics:780;500,nobuttonbar\")
loop
cls
picId := Pic.FileNew (\"hand.bmp\") %Pic must be in the same Folder as the Program
Pic.Draw (picId, handx, handy, picMerge) %X,and Y position of pic
Pic.Free (picId)
for x : 1 .. scabecount
drawfilloval (scabex (x), scabey (x), 2, 2, 4)
end for
locatexy (10, 10)
timecounter := timecounter + 1
put \"Time survived: \", tim ..
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
here is the pics
krisko- Mini Octorok
- Number of posts : 16
Registration date : 2008-03-19
Re: Turing --Help
Cool. I'll play that. Oh, I and fixed mine as well. I have no idea where those slashes came from
Wierd.
Just copy the New code from the old spot
Anyways, I'm goin to bed, I got a splitting headache right now
Wierd.
Just copy the New code from the old spot
Anyways, I'm goin to bed, I got a splitting headache right now
Onyx- Administrator
- Number of posts : 403
Registration date : 2007-11-09
G.W. Stats
Gangsta Name: Pimp Slap Sr.
Gang:
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|