1
Graphics / I can't draw items inside a linked list?
« on: June 27, 2010, 06:24:18 am »
Hi, thanks for replying
I'll admit that I'm a bit of a beginner at C++ so I appreciate your commentary on how I could improve my code.
Here's the model that I used for each enemy constructor:
The Image and sprite variables are contained in a super class. The functions that I used in this case return references to these variables.
The variables x and y simply set the coordinates (position) of the sprite.
I'll admit that I'm a bit of a beginner at C++ so I appreciate your commentary on how I could improve my code.
Here's the model that I used for each enemy constructor:
Code: [Select]
Enemy1(int x, int y):Enemy(x,y){
getImage().LoadFromFile("src/Images/Enemy1.png");
getSprite().SetImage(getImage());
}
The Image and sprite variables are contained in a super class. The functions that I used in this case return references to these variables.
The variables x and y simply set the coordinates (position) of the sprite.