Click here to Skip to main content
15,868,141 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6425-Mar-11 14:40
professionalRichard Andrew x6425-Mar-11 14:40 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S25-Mar-11 14:54
Cyclone_S25-Mar-11 14:54 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6425-Mar-11 14:57
professionalRichard Andrew x6425-Mar-11 14:57 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S26-Mar-11 13:09
Cyclone_S26-Mar-11 13:09 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6426-Mar-11 13:50
professionalRichard Andrew x6426-Mar-11 13:50 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S27-Mar-11 13:27
Cyclone_S27-Mar-11 13:27 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6427-Mar-11 14:12
professionalRichard Andrew x6427-Mar-11 14:12 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S27-Mar-11 14:25
Cyclone_S27-Mar-11 14:25 
The snake automaticaly moves once the right key is pressed. It sorta works but not sure on how to code it for it moving downwords.

Here is the move_snake function;

void move_snake()
			{
				if(x2 ==1) // Move snake right.
				{
					segments[last]->panel->Left = x + segments[last]->panel->Width + 2;
					x = segments[last]->panel->Left;
					y = segments[last]->panel->Top;
					last++;
					if(last >= size){last=0;}
				} 
				if(y2 == -1) // Move snake down.
				{
					segments[last]->panel->Top = y + segments[last]->panel->Height + 2;
					segments[last]->panel->Left = x;
					x = segments[last]->panel->Left;
					y = segments[last]->panel->Top;
					last++;
					if(last >= size){last=0;}
				} 
				
			}


Would you be able to help with the code. It would be much aprecieated. Thanks.
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6427-Mar-11 15:24
professionalRichard Andrew x6427-Mar-11 15:24 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S28-Mar-11 13:21
Cyclone_S28-Mar-11 13:21 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S30-Mar-11 13:22
Cyclone_S30-Mar-11 13:22 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6430-Mar-11 14:41
professionalRichard Andrew x6430-Mar-11 14:41 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S31-Mar-11 9:14
Cyclone_S31-Mar-11 9:14 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S16-Apr-11 8:44
Cyclone_S16-Apr-11 8:44 
Questionissue while loading MFC extension dll dynamically Pin
ptr_Electron24-Mar-11 23:37
ptr_Electron24-Mar-11 23:37 
AnswerRe: issue while loading MFC extension dll dynamically Pin
Richard MacCutchan25-Mar-11 0:02
mveRichard MacCutchan25-Mar-11 0:02 
GeneralRe: issue while loading MFC extension dll dynamically Pin
ptr_Electron25-Mar-11 0:21
ptr_Electron25-Mar-11 0:21 
GeneralRe: issue while loading MFC extension dll dynamically Pin
Richard MacCutchan25-Mar-11 1:03
mveRichard MacCutchan25-Mar-11 1:03 
GeneralRe: issue while loading MFC extension dll dynamically Pin
ptr_Electron25-Mar-11 2:50
ptr_Electron25-Mar-11 2:50 
GeneralRe: issue while loading MFC extension dll dynamically Pin
Richard MacCutchan25-Mar-11 4:24
mveRichard MacCutchan25-Mar-11 4:24 
QuestionInstances of an object Pin
Cyclone_S19-Mar-11 15:47
Cyclone_S19-Mar-11 15:47 
AnswerRe: Instances of an object Pin
John Schroedl19-Mar-11 17:51
professionalJohn Schroedl19-Mar-11 17:51 
GeneralRe: Instances of an object Pin
John Schroedl19-Mar-11 18:01
professionalJohn Schroedl19-Mar-11 18:01 
GeneralRe: Instances of an object Pin
Cyclone_S20-Mar-11 9:56
Cyclone_S20-Mar-11 9:56 
AnswerRe: Instances of an object Pin
Luc Pattyn20-Mar-11 10:47
sitebuilderLuc Pattyn20-Mar-11 10:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.