I've been trying to make various applet and have been giving them to my friend so he can put them on his website. Normally all of the applets work just fine whenever I do not include a library in it, but when I do and send the necessary files, they never work, giving the error "Failed to load Main-class manifest attribute from ... .jar." I was confused at what he was saying, and then I found out if I just hit the .jar file on my computer it comes up with the same file. How to I get this issue to resolve?
Right now I have arrays for a class of jumps and blocks on a map, and a character to jump over them. If have the constructors for them in setup, and the function in draw, like so:
void setup() {
m1=new map1();
p1=new pit(800);
for(int i=0; i<b1.length; i++){
b1[i]=new block(bxs[i],300,n1);
for(int j=0; j<j1.length; j++){
j1[j]=new jump(jxs[j]);
n1=new nicolai(j1[j],b1[i],p1);
}
}
}
void draw{
background(0);
if(!keys[1] && !keys[2]){
xvel=3;
xacc=0;
}
if(keys[1] || keys[2]){
xacc=.1;
}
if(xvel>=10){
xacc=0;
}
m1.display();
p1.display();
for(int i=0; i<j1.length; i++){
j1[i].display();
}
n1.block();
n1.fall();
n1.jump();
n1.update();
n1.display();
n1.restart();
for(int i=0; i<b1.length; i++){
b1[i].display();
b1[i].coin();
}
}
However, when I have the functions involving the jumps and the blocks interacting with the character, it only counts the last ones because of the array and only one character...is there an easy way to have it include all of them.
Hey, guys, I'm on my most hated error, since they always take forever for me too find/fix. I have a boolean in a class with a value referenced in another class, like this.
Sorry for the choppy pieces, of code, but if I were to fully put it, there would be waaaay to much. The bolded line is the code that always says that I'm pointing to a null value, and I know that it is the bb.bx and the bb.by, but I have no clue on why, or how to fix it. Any help would be awesome.
Hey everyone, I'm was going through my sketch, a run and jump game. I was going through the jumps, trying to see if the jumps worked if there was more than one....Needless to say, it didn't. I put the person on the jump as a boolean, and if it was there, the endingy would be of the jump. The jump part of the code is this:
Hey, everyone...I wondering how to get more than one of a class into a main one. Here's some pseudo-code to show what I mean:
jump j1,j2
character c1;
void setup(){
size(200,200);
c1=new character(100,100,j1);
j1=new jump(200,100);
j2=new jump(400,100);
}
void draw(){
j1.display();
j2.display();
c1.display(); c1.move(); c1.jump();
class character{
int x,y;
jump j1;
character(int ix,int iy,jump ij1){
x=ix;
y=iy;
j1=ij1;
}
void display(){
rect(x,y,20,20);
}
void move(){
//code for moving
}
void jump(){
//code for jumping over j1.
}
class jump{
int x,y;
jump(int ix, int iy){
x=ix;
y=iy;
}
void display(){
rect(x,y,50,20);
}
Instead of having to redo character over and over again, how would you just put all of the jumps into the character class? Any help would be very appreciated.
While going through the program I am trying to make, I realized that I should try to clean it up, or else the code will get much more confusing and very lengthy. I'm trying to make a game basically just like mario, and im manually putting in all of the jumps because im not skilled enough to use it with a map. To make everything work I made booleans of the jump's variables and the character's variables. I only have one jump for now, but once I would get more, it would make much unnecessary work. I got the x variable of the character (nx) just in public, and that works just fine, but now im trying to have the class of jump extend the character class, and its just not working. Here's the code for these
Every time I actually use the extends and put the endingy or the whole jump function over or use super, it just doesn't jump at all, or I try other things and get random class/inheritance errors. Sorry for the long lists of code, I'm not really good with judging how much is necessary. Thanks for any help!!! much appreciated
Hello, I'm trying to make a run and jump type mini-game thing, and I'm having difficulties with multiple keys. I picked option 2 from this site:
http://wiki.processing.org/w/Multiple_key_presses and it worked well to do the 2 keys at once. However, if I let go of the second key I pressed down, it also reads it as I let go of the first one, too....Is there a good way to fix this?