Home > Software engineering >  Questions about MFC to write the snake
Questions about MFC to write the snake

Time:10-17

Is that we have not learned snake, but a c + + course to draw the topic of snake, the teacher asked us to self-study, MFC has to do with MFC, so I according to the online "hold MFC snake" made a (that is, all in this one class CSNAKEView complete) similarly, change their code, and then to the teacher asked the teacher can according to the written as, the teacher says he must, in accordance with the sort of, points to several classes (such as CFence class, CFood class), and also requires a variety of integrated derived... Said must press his template to write, to help you great god how to do it better...... Need to see about and then write their own
Mainly such as I wrote before the static struct Snake function to define the coordinates of the length and direction, and the Food, but if make class alone, I don't know how to invoke the previously defined in another class member...
Each great god! The first post! Also hope you forgive me!!!!

CodePudding user response:

Before I wrote like this



Then the teacher asked to write like this

CodePudding user response:

Search "" Visual c + + classic case of game development, rounding" source code"

CodePudding user response:

Can put you off part of the function, now split into several categories, is your teacher said, each function are encapsulated into a class, and then by creating a class object to manipulate the corresponding method

CodePudding user response:

The first figure is the C language programming
The second figure is a c + + programming

CodePudding user response:

Object-oriented c + +, of course, going to class
  • Related