4
สร้างระบบตามพฤติกรรม / ส่วนประกอบสำหรับเกม
พื้นหลัง ฉันพัฒนาเกมเป็นงานอดิเรกและกำลังมองหาวิธีที่ดีกว่าในการออกแบบพวกเขา ปัจจุบันฉันใช้วิธีมาตรฐาน OOP (ฉันได้ทำการพัฒนาองค์กรเป็นเวลา 8 ปีแล้ว ยกตัวอย่างเช่น "baddie" public class Baddie:AnimatedSprite //(or StaticSprite if needed, which inherit Sprite) { //sprite base will have things like what texture to use, //what the current position is, the base Update/Draw/GetInput methods, etc.. //an AnimatedSprite contains helpers to animated the player while //a …