Computer Science Canada

Colourback problems...

Author:  Nemi [ Tue Jun 10, 2003 7:38 pm ]
Post subject:  Colourback problems...

Er... I'm sort of stuck here... hope any of you could help... Shocked

Anyways, I'm doing that 'Snake' game thing as a final project, however, because it's my first year and all, it's pretty much a text version of the game (with a limited knowledge on graphic importation)...

So here's my problem:
I first started the code in Turing 3 and used

var SNAKE :string := chr (157)
put SNAKE (1)

to isolate the colourback on just that character.

Next thing you know, my teacher gets Turing 4... and apparently this 'SNAKE (1)' snippet doesn't work anymore -- the colourback continues across the screen regardless of where the snake moves. (Click here for a screenshot)

Is there any way in which I can isolate the colourback on that single character without using a for loop? (I've tried that already and failed miserably.)

NOTE! I'm pretty new at all this, so I'm not that advanced at the coding and stuff... Rolling Eyes

Author:  Tony [ Tue Jun 10, 2003 8:00 pm ]
Post subject: 

I would recommend keeping background color the same, and just have a contrasting color of your text instead. I think using '@' character would work best since its round and takes up a lot of area.

Author:  Nemi [ Tue Jun 10, 2003 8:14 pm ]
Post subject: 

Ehhh... more problems...

I've changed the colourback to match with background. Which is good, you can't see the green.

Problem #2:
The 'hidden' colourback erases any 'food' that appears on the right if you move the 'snake' to the left side of the 'food'. (Because the colourback extends to the right end of the screen and erases it) ._.;;

Author:  Tony [ Tue Jun 10, 2003 8:26 pm ]
Post subject: 

if you dont use colorback at all, the problem shouldn't occur.

Use Draw.FillBox and Draw.FillOval... that would make things simpler too.

Author:  Nemi [ Tue Jun 10, 2003 8:28 pm ]
Post subject: 

Alright... I'll try that out. Thanks! Very Happy

Author:  Andy [ Wed Jun 11, 2003 3:39 pm ]
Post subject: 

or that when ur inputing something, put .. after everything that way the line won't show
when u wanna go to the next line just use
and put .. after that one too