Sorry, Extreme Beginner here [message #1002636] |
Sat, 19 January 2013 01:29 |
Chris L Messages: 1 Registered: January 2013 |
Junior Member |
|
|
Okay, sorry if this is the wrong section, I don't know too too much about coding, but I've started to make a game. Its fairly simple. But I have a couple of problems. 1.) i am trying to make a randomly generated 2D terrain, I have 3 PNG's ready: Stone, Dirt and an ore (which i am trying to get to randomize and become rare), each is 32 X 32 pixels. I heard a simple algorithm would work, but i have no knowledge on how to do so. 2.) I am trying to make my character move, here's my code: public void keyPressed(KeyEvent e){
int key = e.getKeyCode();
if (key == KeyEvent.VK_LEFT);
dx = -1;
if (key == KeyEvent.VK_RIGHT);
dx = 1;
}
public void keyReleased(KeyEvent e){
int key = e.getKeyCode();
if (key == KeyEvent.VK_LEFT);
dx = 0;
if (key == KeyEvent.VK_RIGHT);
dx = 0;
}
}
3.) I am trying to make health bar, and creatures that will hit the main character and make he/she lose some health, varying on the creature and such.
Again, Apologies for putting in the wrong section, Im new to the forums, I know very little C++, i just use tuts online, so if you could explain to me waht to do that'd be great (to avoid future accidents). Thanks Again! -Chris
|
|
|
Powered by
FUDForum. Page generated in 0.02955 seconds