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

Username:   Password: 
 RegisterRegister   
 Turing Snake Movement Problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
iowndd




PostPosted: Sun Jun 17, 2012 1:51 pm   Post subject: Turing Snake Movement Problem

What is it you are trying to achieve?
I am trying to make a snake game, where the snake moves based on the user's key inputs. The snake will also eat food after which it will grow and the food position will be randomized.


What is the problem you are having?
The snake is not moving even though the specified boolean's and if statements are set up.


Describe what you have tried to solve this problem
I have tried to proof read my code but sadly no luck, it might be a small problem that I am having that I am not aware of.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
My code is in the attachments section

Turing:


<Add your code here>



Please specify what version of Turing you are using
I am using Turing version 4.1 most likely



mouse.jpg
 Description:
Pic needed for the game
 Filesize:  1000 Bytes
 Viewed:  2355 Time(s)

mouse.jpg



snake_body.jpg
 Description:
Pic needed for the game
 Filesize:  884 Bytes
 Viewed:  2355 Time(s)

snake_body.jpg



Example2.t
 Description:
My actual game

Download
 Filename:  Example2.t
 Filesize:  3.78 KB
 Downloaded:  108 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Sun Jun 17, 2012 2:44 pm   Post subject: Re: Turing Snake Movement Problem

When in the game loop do you actually draw the snake?
iowndd




PostPosted: Sun Jun 17, 2012 3:06 pm   Post subject: Re: Turing Snake Movement Problem

I don't draw it inside the loop, I draw it before


for i : 30 .. (30 + body_size)
Pic.Draw (snake_body (i), snake_x (i), 200, picCopy)
end for


Right there
Raknarg




PostPosted: Sun Jun 17, 2012 3:35 pm   Post subject: RE:Turing Snake Movement Problem

So... You never update the snakes position, right? How do you expect it to move when you only drew it once?
Dreadnought




PostPosted: Sun Jun 17, 2012 3:43 pm   Post subject: Re: Turing Snake Movement Problem

Imagine the screen is a piece of paper.
You draw a circle on it.
Should the circle move around for any reason?
iowndd




PostPosted: Sun Jun 17, 2012 3:47 pm   Post subject: Re: Turing Snake Movement Problem

Oh I see, that was a dumb mistake, thank you for the help
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  [ 6 Posts ]
Jump to:   


Style:  
Search: