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

Username:   Password: 
 RegisterRegister   
 final assessment..please help! :!:
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
koolmoe




PostPosted: Mon Jan 13, 2003 7:36 pm   Post subject: final assessment..please help! :!:

Hey guys, i'm just needing your help with picking a topic to do for my final assessment. I was thinking about tetris but i think it's a little too advance for me. I need sumthin that does not involve too complicated things to create for my final project. Thx in advance and please help!
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Mon Jan 13, 2003 7:45 pm   Post subject: ideas

well pong is very easy to make in turing and you can find a lot of eaxmples of how to make a pong game on the net. all you need is some simpel conslion diection colations wich we have turrales for on the site and then you can use pics or the draw comand to make the ball.

there is a lot of stuff you can do, if you relay dont know a lot about turing you coude make a dice game where the user has to guse the number or somting. i whode look at the swat ftp site for some ideas ftp://swat@danco.no-ip.com or in the sumbsions section.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
koolmoe




PostPosted: Mon Jan 13, 2003 8:28 pm   Post subject: thx for the reply..

yea people have done pong already...i was thinking about pacman? i've already started with the movement of the pacman guy, but i think the monsters would be hard...A little assist?
koolmoe




PostPosted: Mon Jan 13, 2003 8:32 pm   Post subject: thx for post..

Yea pong has been done, too bad :@ Well i was thinking about pacman..i've got the moving pacman figure, i just don't kno how to make borders, and enemy stuff. ANy advice?
Tony




PostPosted: Mon Jan 13, 2003 9:00 pm   Post subject: (No subject)

you'd have to keep borders in the array and before pacman moves you check if that new location is the same as any of the walls or not.

for enemies... well you need an AI which is one of my weaknesses Embarassed You can make a VERY simple one where you determine aproxemate direction in which emenies must follow packman... you can easily trick them though since they'll just try to go straight Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
koolmoe




PostPosted: Mon Jan 13, 2003 9:09 pm   Post subject: hmm...

hey tony i think i'm getting the idea, but i'm still a little confused..do you think you can provide a sample code? like so far this is what i got..

var x, y : int
x := 100
y := 100
var ch : string (1)
loop
getch (ch)
if ch = chr (200) then
y := y + 5
drawfillarc (x, y, 10, 10, 360, 350, red)
delay (100)
drawfillarc (x, y, 10, 10, 360, 350, white)
drawfillarc (x, y, 10, 10, 130, 45, red)
delay (100)
drawfillarc (x, y, 10, 10, 130, 45, white)
end if
if ch = chr (205) then
x := x + 5
drawfillarc (x, y, 10, 10, 360, 350, red)
delay (100)
drawfillarc (x, y, 10, 10, 360, 350, white)
drawfillarc (x, y, 10, 10, 360, 300, red)
delay (100)
drawfillarc (x, y, 10, 10, 360, 300, white)
end if
if ch = chr (203) then
x := x - 5
drawfillarc (x, y, 10, 10, 360, 350, red)
delay (100)
drawfillarc (x, y, 10, 10, 360, 350, white)
drawfillarc (x, y, 10, 10, 210, 150, red)
delay (100)
drawfillarc (x, y, 10, 10, 210, 150, white)
end if
if ch = chr (208) then
y := y - 5
drawfillarc (x, y, 10, 10, 360, 350, red)
delay (100)
drawfillarc (x, y, 10, 10, 360, 350, white)
drawfillarc (x, y, 10, 10, 310, 230, red)
delay (100)
drawfillarc (x, y, 10, 10, 310, 230, white)
end if
end loop

just directions..the animation sux cuz i can't get it to not stop flickering!
Tony




PostPosted: Mon Jan 13, 2003 10:04 pm   Post subject: (No subject)

I don't have any sample code for pacman Sad

here're a few tips:

since pacman is suppost to keep on moving even if no button is pressed, you should use
code:

if hasch
     getch(c)
else
     c:= (direction currently used)
end if

movement code here...


to get rid of flashing, you can read a tutorial on "smooth animation" in tutorial section (if you're using turing 4.x+ that is)

Now you need to create a 2D boolean array (lets call it wall) and fill it with true for wall and false for empty space. then before you "move" you put an if statment like this:
code:

if wall(currentX + movementX, currentY + movementY) = true %if there's a wall

then

%you can't move, do nothing
c:=s %direction variable set to s for stop ;)

else

%way is free

currentX := currentX + movementX
currentY := currentY + movementY

end if

Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
koolmoe




PostPosted: Mon Jan 13, 2003 11:41 pm   Post subject: NICE!

ohh alright man..thx i'm starting to get the hang of this...
Sponsor
Sponsor
Sponsor
sponsor
koolmoe




PostPosted: Mon Jan 13, 2003 11:56 pm   Post subject: confusion..

him alright sorry for being completely dumb lol but i don't know how i should incorporate that into my code..i attached my coding so far, and i'd appreciate your help. Thx again.


pacman.t
 Description:

Download
 Filename:  pacman.t
 Filesize:  1.12 KB
 Downloaded:  278 Time(s)

Tony




PostPosted: Tue Jan 14, 2003 12:23 am   Post subject: (No subject)

well for the hasch part, you just copy the code from above and put it in place of getch.

for walls you have to set up an array first and fill it with level information. I'm not going to do that for you.

though it should be something like

var wall:array 1..20, 1..20 of boolean

then you ether manually fill out each cell or load it from the text file (is so, this feature can be used as a level editor later on)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
koolmoe




PostPosted: Tue Jan 14, 2003 1:06 am   Post subject: hmm...

the hasch code doesn't work..i think i need sum1 to show me what you're talking about..i'll see if my friends understand. Thx for being so helpful tho!
Tony




PostPosted: Tue Jan 14, 2003 12:52 pm   Post subject: (No subject)

Did you just copy the code or did you read the code?

I missed "then" Confused

code:

if hasch then
      getch(c)
      ...rest
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
koolmoe




PostPosted: Thu Jan 16, 2003 8:11 pm   Post subject: weirdness..

Ok i've got the movement going, but before my level starts, pacman is not visible. he's only visible once i move him...any ideas?
Tony




PostPosted: Thu Jan 16, 2003 10:52 pm   Post subject: (No subject)

once your level starts, but before you enter main loop, call the movement procedure (or whatever draws your packman) with movement parameter set to 0(no moving direction)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 14 Posts ]
Jump to:   


Style:  
Search: