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

Managed C++/CLI

 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6426-Mar-11 14:50
professionalRichard Andrew x6426-Mar-11 14:50 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S27-Mar-11 14:27
Cyclone_S27-Mar-11 14:27 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6427-Mar-11 15:12
professionalRichard Andrew x6427-Mar-11 15:12 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S27-Mar-11 15:25
Cyclone_S27-Mar-11 15:25 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6427-Mar-11 16:24
professionalRichard Andrew x6427-Mar-11 16:24 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S28-Mar-11 14:21
Cyclone_S28-Mar-11 14:21 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S30-Mar-11 14:22
Cyclone_S30-Mar-11 14:22 
GeneralRe: Animating a snake (aka Snafu) Pin
Richard Andrew x6430-Mar-11 15:41
professionalRichard Andrew x6430-Mar-11 15:41 
I think you should simplify the collision function. I don't think you need two loops.

If you want to check whether the head is colliding with any of the other segments, then just do:

for (int ThisSegment = 0; ThisSegment < (size-1); ThisSegment ++ )
{
    if ( ThisSegment == head ) continue;

    if ( segments[ThisSegment]->panel->Left == segments[head]->panel->Left &&
         segments[ThisSegment]->panel->Top  == segments[head]->panel->Top )
    {
        Timer->Stop();
    }
} 

The difficult we do right away...
...the impossible takes slightly longer.

GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S31-Mar-11 10:14
Cyclone_S31-Mar-11 10:14 
GeneralRe: Animating a snake (aka Snafu) Pin
Cyclone_S16-Apr-11 9:44
Cyclone_S16-Apr-11 9:44 
Questionissue while loading MFC extension dll dynamically Pin
ptr_Electron25-Mar-11 0:37
ptr_Electron25-Mar-11 0:37 
AnswerRe: issue while loading MFC extension dll dynamically Pin
Richard MacCutchan25-Mar-11 1:02
mveRichard MacCutchan25-Mar-11 1:02 
GeneralRe: issue while loading MFC extension dll dynamically Pin
ptr_Electron25-Mar-11 1:21
ptr_Electron25-Mar-11 1:21 
GeneralRe: issue while loading MFC extension dll dynamically Pin
Richard MacCutchan25-Mar-11 2:03
mveRichard MacCutchan25-Mar-11 2:03 
GeneralRe: issue while loading MFC extension dll dynamically Pin
ptr_Electron25-Mar-11 3:50
ptr_Electron25-Mar-11 3:50 
GeneralRe: issue while loading MFC extension dll dynamically Pin
Richard MacCutchan25-Mar-11 5:24
mveRichard MacCutchan25-Mar-11 5:24 
QuestionInstances of an object Pin
Cyclone_S19-Mar-11 16:47
Cyclone_S19-Mar-11 16:47 
AnswerRe: Instances of an object Pin
John Schroedl19-Mar-11 18:51
professionalJohn Schroedl19-Mar-11 18:51 
GeneralRe: Instances of an object Pin
John Schroedl19-Mar-11 19:01
professionalJohn Schroedl19-Mar-11 19:01 
GeneralRe: Instances of an object Pin
Cyclone_S20-Mar-11 10:56
Cyclone_S20-Mar-11 10:56 
AnswerRe: Instances of an object Pin
Luc Pattyn20-Mar-11 11:47
sitebuilderLuc Pattyn20-Mar-11 11:47 
GeneralRe: Instances of an object Pin
Cyclone_S20-Mar-11 15:47
Cyclone_S20-Mar-11 15:47 
AnswerRe: Instances of an object Pin
Luc Pattyn20-Mar-11 15:50
sitebuilderLuc Pattyn20-Mar-11 15:50 
GeneralRe: Instances of an object Pin
Cyclone_S20-Mar-11 16:30
Cyclone_S20-Mar-11 16:30 
GeneralRe: Instances of an object Pin
John Schroedl21-Mar-11 5:02
professionalJohn Schroedl21-Mar-11 5:02 

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.