Archived
0

fix(display) Переместили персонажа вниз экрана

This commit is contained in:
2013-10-09 17:13:34 +04:00
parent 142816a06a
commit b91ca5c7c5
2 changed files with 9 additions and 8 deletions

View File

@@ -70,28 +70,28 @@ public class Foxy {
if(inverse){ if(inverse){
GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y1)); GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y1));
GL11.glVertex2f(x, 0); GL11.glVertex2f(x, y);
GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y1)); GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y1));
GL11.glVertex2f(x + current_texture.getWidthSprite()*K, 0); GL11.glVertex2f(x + current_texture.getWidthSprite()*K, y);
GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y2)); GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y2));
GL11.glVertex2f(x + current_texture.getWidthSprite()*K, current_texture.getHeightSprite()*K); GL11.glVertex2f(x + current_texture.getWidthSprite()*K, y + current_texture.getHeightSprite()*K);
GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y2)); GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y2));
GL11.glVertex2f(x, current_texture.getHeightSprite()*K); GL11.glVertex2f(x, y + current_texture.getHeightSprite()*K);
} else { } else {
GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y1)); GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y1));
GL11.glVertex2f(x, 0); GL11.glVertex2f(x, y);
GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y1)); GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y1));
GL11.glVertex2f(x + current_texture.getWidthSprite()*K, 0); GL11.glVertex2f(x + current_texture.getWidthSprite()*K, y);
GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y2)); GL11.glTexCoord2f(current_texture.floatX(frame.x2), current_texture.floatY(frame.y2));
GL11.glVertex2f(x + current_texture.getWidthSprite()*K, current_texture.getHeightSprite()*K); GL11.glVertex2f(x + current_texture.getWidthSprite()*K, y + current_texture.getHeightSprite()*K);
GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y2)); GL11.glTexCoord2f(current_texture.floatX(frame.x1), current_texture.floatY(frame.y2));
GL11.glVertex2f(x, current_texture.getHeightSprite()*K); GL11.glVertex2f(x, y + current_texture.getHeightSprite()*K);
} }
GL11.glEnd(); GL11.glEnd();

View File

@@ -68,6 +68,7 @@ public class Main {
init_opengl(width, height); init_opengl(width, height);
foxy = new Foxy(); foxy = new Foxy();
foxy.setY(Display.getHeight() - (34*4));
while(!Display.isCloseRequested()){ while(!Display.isCloseRequested()){
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);