Hey guys, I'm in my first programming/coding class and I'm having a little bit of trouble with my final project and am wondering if anyone could help.
For the project I have created a maze game. This game is made of three mazes, each images I have made in photoshop, once you get to the end of the first maze, you go to the next and so on.
For the character to remain constrained in the maze I am coding it based on the color of the pixels, it'll only move in the white areas. The first map works perfectly, but when I get to the next map the character is not constrained anymore, it'll float right over the lines of the map. Can anyone help with this?
Again, I'm pretty new at this, so I would appreciate input! Thank you!
int page = 1;
PImage map1;
PImage map2;
PImage map3;
PImage last;
PImage trainer;
import ddf.minim.*;
Minim minim;
AudioPlayer song;
int x = 20; //map 1
int y = 20;
int xm2 = 20; //map 2
int ym2 = 20;
int xm3 = 20; //map 3
int ym3 = 20;
int trainerwidth = 20;
int trainerheight = 20;
void setup() {
size(500,700);
trainer = loadImage("pokemontrainer.jpg");
map1 = loadImage("map1.jpg");
map2 = loadImage("map2.jpg");
map3 = loadImage("map3.jpg");
last = loadImage("last.jpg");
minim = new Minim(this);
song = minim.loadFile("pokemon8bit.mp3");
song.play();
}
void draw() {
smooth();
background(255);
if (page == 1) {
image(map1, 0, 0);
// make trainer
image(trainer, x, y, trainerwidth, trainerheight);