This site requires JavaScript, please enable it in your browser!
Greenfoot back
Canning
Canning wrote ...

2011/9/11

Image

1
2
3
danpost danpost

2011/11/1

#
nvm, (double post -- did not think I had posted since it was on a new page)
danpost danpost

2011/11/1

#
I ran the code you gave above, and it seems to be working properly. Maybe your image is off the left edge of the world. Stop the scenario and move the level bar to the center of the world; it was probably working the whole time. The only other thing that I could think, is that somewhere in your code the value of 'nextlvlat' is changed to a number less than one hundred (< 100).
kiarocks kiarocks

2011/11/1

#
it is in the center, and that still happens.
kiarocks kiarocks

2011/11/1

#
click the image to goto the site, it is a little clearer
danpost danpost

2011/11/1

#
Can u upload it momentarily, so I can look at it? I can let you know when I have it, and you can then remove it. Before that, stop the scenario and right-click on the level bar and select 'Inspect' to see the values of 'nextlvlat' and 'exp' to see if they are set appropriately.
kiarocks kiarocks

2011/11/1

#
they are, it is just the image
danpost danpost

2011/11/1

#
The code you posted 23 hours ago does work. But from what I see from it, 'nextlvlat' would have to get to 20,000 to get 'level1' to fill the level bar (unless 'exp' is changed along the way).
kiarocks kiarocks

2011/11/1

#
uploaded
danpost danpost

2011/11/1

#
Got it! Will look at it and let you know what I find.
kiarocks kiarocks

2011/11/1

#
and a side note, can you convert these .jars made by greenfoot to .exes?
danpost danpost

2011/11/1

#
I do not believe I have that capability.
kiarocks kiarocks

2011/11/1

#
but is it possible? i am doing this for a contest and they want a .exe
danpost danpost

2011/11/2

#
So far, i 'inspect'ed the level bar after starting and stopping the scenario, and found zero to be the value of 'last', 'valuel1', 'exp' and 'nextlvl'. Being 'exp' is a factor in the level, and its value is zero, it is no wonder there is no green in the level bar, as 'value1' gets a new value when 'exp' is NOT zero. 'value1' never gets increased, and when changing the 'value1' in the 'img2' declaration, that group of bracketed statements never executes because 'value1' is zero. Therefore, to test, change 'if (level1 > 0)' to 'if (true)' and insert as the first statement in that 'if's group of statements 'if (level1 == 0) level1 = 1;', then change 'value1' in the 'img2' declaration to 50 or 100 or whatever, and see if it works then.
danpost danpost

2011/11/2

#
As far as making '.exe' files out of the scenarios, you may want to start a new discussion under 'Other'. davmac, mik, or nccb will probably be able to answer that (and other users, like myself, would like to know also, i am sure). BTW, you can remove the scenario now (no sense in having it on the site, as it is).
kiarocks kiarocks

2011/11/2

#
if you inspect the level bar, you will come across a method called chgxp under inherited from level. Use that to change xp
There are more replies on the next page.
1
2
3