
-----------------------------------
koolmoe
Mon Jan 13, 2003 7:36 pm

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!

-----------------------------------
Dan
Mon Jan 13, 2003 7:45 pm

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.

-----------------------------------
koolmoe
Mon Jan 13, 2003 8:28 pm

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
Mon Jan 13, 2003 8:32 pm

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
Mon Jan 13, 2003 9:00 pm


-----------------------------------
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  :oops: 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:

-----------------------------------
koolmoe
Mon Jan 13, 2003 9:09 pm

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
Mon Jan 13, 2003 10:04 pm


-----------------------------------
I don't have any sample code for pacman :(

here're a few tips:

since pacman is suppost to keep on moving even if no button is pressed, you should use

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:

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



-----------------------------------
koolmoe
Mon Jan 13, 2003 11:41 pm

NICE!
-----------------------------------
ohh alright man..thx i'm starting to get the hang of this...

-----------------------------------
koolmoe
Mon Jan 13, 2003 11:56 pm

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.

-----------------------------------
Tony
Tue Jan 14, 2003 12:23 am


-----------------------------------
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)

-----------------------------------
koolmoe
Tue Jan 14, 2003 1:06 am

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
Tue Jan 14, 2003 12:52 pm


-----------------------------------
Did you just copy the code or did you read the code?

I missed "then"  :? 


if hasch then
      getch(c)
      ...rest
end if


-----------------------------------
koolmoe
Thu Jan 16, 2003 8:11 pm

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
Thu Jan 16, 2003 10:52 pm


-----------------------------------
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)
