I am doing like a space invaders game and there's everything ok. But the only way I have to move my spaceship is using the mouse, and I also need to add keyboard movements (left, right and space to shoot), but I don't know how. Please help me!
Here is my code:
//import gif
import gifAnimation.*;
Gif myAnimation;
int recX = width/2;
int recY = height/2;
int skip=2;
int j=0;
int playerHealth=100;
int playerWidth = 55;
int playerHeight = 65;
int playerLives=5;
float posX;
boolean playerAlive=true;
boolean createShips=false;
float time=60;
int level=1;
int wallGap = 50;
Ship[] ships;
Laser[] lasers;
PFont font; //import font
PImage space;//import background
PImage enemy;//import enemy
PImage player;//import spaceship
PImage explosion;//import explosion gif
void setup()
{
size(800, 600);//background
noStroke();//images without stroke
font = loadFont("AddElectricCity-48.vlw");//load font
When I click on a button (for example 'studio') it appears a new background and I need that in that new background show me a text file that when I click it will appear the whole information.
I need some help tocreate buttons. I want to click on a button created with an image and change the whole 'background' and then it appears OTHER button (image) with the same function (and on and on and on). Please help me. I don't really know how to do and I need this to do an assignment.
I'm new here and I wanna know how do I click on an image (like a button) and it appears a different one (like a new page). This is to do like a 'data file', or like a program that shows me new information when I click on that image (like a web page).
I have "cortinaanimationfilms2.jpg" as a background and I wanna click on "story2.jpg" to show me a different page(image). Can you help me please? It's for college and it's kind of urgent...