UP, DOWN, LEFT, RIGHT movement
in
Programming Questions
•
5 months ago
Hey there, I am currently doing an assignment for a class, and I am having a few troubles trying to get my PImage to move with the arrow keys. The image is a spaceship, and I am creating something similar to frogger. If anyone could tell me a hand that'd be great!
- PImage space;
- PImage trader;
- PImage trader2;
- PImage ship;
- int x;
- int y;
- int thesize;
- boolean left, right, up, down;
- boolean runOnce = true;
- void setup() {
- size (1249,768);
- smooth();
- space = loadImage("space.png");
- trader = loadImage("trader.png");
- trader2 = loadImage("trader2.png");
- x = 220;
- y = 220;
- thesize = 120;
- }
- void draw() {
- background(space);
- imageMode(CENTER);
- fill(256, 165, 0);
- image(trader2,400, 400);
- }
1