Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 jump lame game
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
r.m_spy




PostPosted: Sat Dec 01, 2007 12:16 pm   Post subject: jump lame game

the variables mean nothing, And I do not know how to tag
code:

const SPACE_BAR : char:=chr(32)
var wer:int:=0
var k : array char of boolean
var name:string
var v:int:=10
var u:int:=500
var w:int:=250
var tel:int:=0
var c:int:=100
const UP_ARROW := chr (200)
const ENTER := chr (10)
var l:int:=0
var d:int:=0
procedure check
colorback(black)
color(white)
if v<60 then
if u<60 and u>0 then
cls
colorback(white)
color(black)
drawfill(1,1,white,red)
put"game over"
put"your score was ",l
loop
end loop
end if
end if
end check
procedure check2
colorback(black)
color(white)
if v>60 then
if w<60 and w>0 then
cls
colorback(white)
color(black)
drawfill(1,1,white,red)
put"game over"
put"your score was ",l
loop
end loop
end if
end if
if v<60 then
if u<60 and u>0 then
cls
colorback(white)
color(black)
drawfill(1,1,white,red)
put"game over"
put"your score was ",l
loop
end loop
end if
end if
end check2
procedure CentreText (s : string, row : int)
    locate (row, (maxcol - length (s)) div 2)
    put s
    View.Update
end CentreText
var s:int
procedure CentreFont (s : string, x, y, f, clr : int)
    var w : int := Font.Width (s, f)
    Font.Draw (s, x - w div 2, y, f, clr)
end CentreFont
var displayFont : int := Font.New ("Sanserif:14:bold")
    var announceFont : int := Font.New ("Sanserif:72:bold")
CentreText ("Instructions", maxrow div 2 - 7)
CentreText ("Use the up arrow key to jump", maxrow div 2 - 5)
CentreText ("avoid the grey boxes for as long as possible", maxrow div 2 - 4)
CentreText ("Number in upper-left corner is the score",
    maxrow div 2 - 2)
CentreText ("please wait", maxrow div 2)
delay(5000)
put"skip level"
get s
cls
if s=208 then
elsif s=304 then
else
        CentreFont ("jump: level 1", maxx div 2, maxy div 2, announceFont, brightred)
        delay(1000)
        cls
loop
loop
loop
delay(c)
cls
check
put l
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(u,10,u+40,50,grey)
Input.KeyDown(k)
if k(UP_ARROW) then
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v+10
u:=u-10
check
exit when v=110
end loop
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v-10
u:=u-10
check
exit when v=10
end loop
end if
u:=u-10
exit when u<0
end loop
u:=500
l:=l+1
if c>10 then
c:=c-5
else
c:=c+95
end if
exit when l=5
end loop
        CentreFont ("bonus level", maxx div 2, maxy div 2, announceFont, brightred)
delay(1000)
cls
var po:int:=0
u:=250
loop
loop
delay(c)
cls
check
put l
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(u,10,u+40,50,grey)
Input.KeyDown(k)
if k(ENTER)then
d:=d+1
elsif k(UP_ARROW) then
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v+10
u:=u-10
check
exit when v=110
end loop
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v-10
u:=u-10
check
exit when v=10
end loop
end if
u:=u-10
exit when u<0
end loop
u:=+po+250
po:=po+10
l:=l+1
if c>10 then
c:=c-5
else
c:=c+95
end if
exit when l=10
end loop
exit when l>14
end loop
end if
if s=304 then
else
  CentreFont ("jump : level 2", maxx div 2, maxy div 2, announceFont, brightred)
  delay(1000)
loop
loop
loop
delay(c)
cls
check2
put l,"    (pasword is 208)"
drawfillbox(w,90,w+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(u,10,u+40,50,grey)
Input.KeyDown(k)
if k(UP_ARROW) then
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(w,90,w+40,50,grey)
v:=v+10
w:=w-10
u:=u-10
check2
exit when v=110
end loop
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(w,90,w+40,50,grey)
v:=v-10
u:=u-10
w:=w-10
check2
exit when v=10
end loop
end if
u:=u-10
w:=w-10
exit when u<0
if w=0 then
l:=l+1
end if
end loop
u:=500
w:=250
l:=l+1
if c>10 then
c:=c-5
else
c:=c+95
end if
end loop
end loop
end if
Sponsor
Sponsor
Sponsor
sponsor
Ultrahex




PostPosted: Sat Dec 01, 2007 2:44 pm   Post subject: Re: jump lame game

The Good

Simple Idea for Game Easy To Play, other then that I am sorry to say there is not much. the rest is ideas if you wish to make your game play better, or the game overall more interactive with the user.

The Bad

Ontop of this, yes your variable names are terrible, and pointless delays at start are very annoying for people running your programming, they are waiting 5 seconds just to begin playing your game!,

Also your not stating that your input has to be numbers at skip level, which is a hassle cause i had to look at your code to figure out what to type in. this is problem because you are not specifying valid input to that screen and not catching invalid input. Why not make a menu in which you select Play Game! or Enter Secret Code instead?

There is also much more work that can be done on this game!, for instance: Powerups, Faster, Less Flicker, Smoother GamePlay!
All of these can be easily accomplished by instead of using delays, you could use max frames per second.
Oh and i forgot you didn't comment your code at all!

Leftover Issues

Tagging is simple!, all you must do is:

[code]
Your Code Here
[/code]

or if you want it syntax highlighted:

[syntax="turing"]
Turing Code Here
[/syntax]
r.m_spy




PostPosted: Sat Dec 01, 2007 3:33 pm   Post subject: Re: jump lame game

to poster

thank you for your support. the programs I posted has already been created. [code]
how it's done[code/]
Saad




PostPosted: Sat Dec 01, 2007 4:44 pm   Post subject: RE:jump lame game

Just because a program has been created doesn't mean it can't be edited to reflect good programming techniques.
LaZ3R




PostPosted: Mon Dec 03, 2007 2:08 pm   Post subject: RE:jump lame game

Don't make your user wait 5 seconds each time they want to play.

In the turing help menu, search up View.Update. Any graphic based games in turing really need it as it prevents flickering from occuring on the screen. Much more easy on the eyes Smile

Also, you're code is practically impossible to debug for yourself should something go wrong. Use proc's... a lot of them. They are very helpful in so many ways and keep everything organized.

You have a lot of repeating code as well, cases like those, once again, really prove you should be using procs. Keeps the code much smaller, much more effective, much easier to fix should something go wrong.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: