Hi everyone :) I'm writing project for my studies and my idea is write a game something like Snake. I have big problem with checking pixels, OK I'll explain it. I draw a line on LCD, draw and draw but as you see on movie if the "snake" enters on himself there should to end game and show "GAME OVER", but I don't know how can I check it. I have some idea for it. I declarated a table which has two dimensions - height and width LCD. When "snake" go anywhere, for example if he goes up, he safe "1" to the table on current coordinates x and y. One word - it safe last position. And there I check if new position will be "1" program stop. At the beginnig all table has "0". Every draw pixel put "1" to the table. I think you understand my idea. But...It doesn't work. I don't know why. When I flash processor everything stop and I can see only white display...No reaction. It works when I give small table...not as a LCD size, for example 50x50 ([50][50]) and draw snake on small place on the LCD. How can I do it...? I hope that you help me with it. And the movie... sorry for quality.
www.youtube.com/watch
and code...I must safe it to txt file because my thread is too long (when I have written it, there was error about to much words on text)
www.dropbox.com/.../main.c
I think that it looks like good for analyze and watch ;)