Question 1 -
The following code is how I place a player onto the field, what if I wish to make them transperant of 50%? I have tried glColor4f(1.0f, 1.0f, 1.0f, 0.5f); but it isn't that simple.
class player_graphics
{
glLoadIdentity();
glTranslatef(x, y, z);
glColor3f(1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-bl, 0.0f, 0.15f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(bl, 0.0f, 0.15f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(bl, (bh*2), 0.15f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-bl, (bh*2), 0.15f);
glEnd();
}
Question 2 -
Which is faster?
ball[0]=1;
ball[1]=1;
ball[2]=1;
OR
ball[0]=ball[1]=ball[2]=1;
Or doesn't it make any differance?
Question 3 -
How do I delete an array during the running of a program?
Question 4 -
When a class item is made I assume that the whole class item is put into memory, to free up memory is it possible to delete the class item if I no longer need it? How would I delete it?
eg
Class button
{
//Make button
}
//If the player is in the start screen
new_game button(); //Make this button
//If the player leaves the start screen and I no longer have any need for the new_game button
delete new_game button? or is it ~new_game button?
///////////////////
Question 5 -
Is there any quickler way of doing this? Note that the second figure is increasing by 20;
button hire0(600.0f, 150.0f, 250, 1.0f, 0.4f);
button hire1(600.0f, 170.0f, 250, 1.0f, 0.4f);
button hire2(600.0f, 190.0f, 250, 1.0f, 0.4f);
button hire3(600.0f, 210.0f, 250, 1.0f, 0.4f);
button hire4(600.0f, 230.0f, 250, 1.0f, 0.4f);
//////////////////////