Windows XP? And do you want to remove it as in get rid of all the data on it? If so...
Start => Run => compmgmt.msc, click on disk management, right click on the partition you want to delete and select delete partition. It probably goes without saying, but remember you will lose all the data on that partition when you delete it!!
Yeah i know how to do that, but what I was wondering was if there was a way to combine them through windows XP. Turns out there's not and the only way to do so is to reformat...So, that's what I've been doing for the past 3 or so hours.
BTW, they built that feature into Vista, yet they won't update XP to include it...
832 :P
A new version of this scenario was uploaded on Thu Apr 30 01:09:45 UTC 2009
I need help with my bomb class. It probably seems stupid, but I've been trying at it for a while now, and cant get the result i want. I know it's probably a simple problem, and when I find it I'm gonna feel like a dumbass...
The problem is here:
public void kill()
{
enemy = new Enemy();
getWorld().getObjects(Enemy.class);
getWorld().removeObject(enemy);
}
In this method you're doing 3 things:
1) Creating a new enemy
2) Getting all the enemy objects in the world but not storing them anywhere
3) Removing the new enemy you created (but never added to the world.)
What you actually need to do is store the result of the getObjects() method in a variable, and then loop through that list and tell the world to remove each item in it :-)
I actually tried this, but received an error. Maybe I just made a small mistake, I'll try it again. Can't do it at school because I'm supposed to be doing a databases course.............................KILL ME!
When you get your list, try casting it like the following:
List<Enemy> enemies = (List<Enemy>)getWorld().getObjects(Enemy.class);
...and you'll also need to import java.util.List. If that doesn't help then just post the code you get the error for and I'll tell you what's wrong with it!
There is, but you don't need it for this - just use a foreach loop:
for(Enemy enemy : enemies) {
//Do what you like with enemy
}
That will loop through each enemy in enemies so you can do what you like with each of them. It's basically an easier way of writing:
for(in i=0 ; i<enemies.size() ; i++) {
Enemy enemy = enemies.get(i);
}
You CAN use iterators if you like, but they're more commonly used for looping through things like sets and maps (collections that have no defined order).
Foreach loops are a nice quick easy way to loop through an entire collection if you don't need to modify its contents (and most of the time, you generally don't.) When you do need to modify an element then you'll have to either use a for loop or an iterator.
java.lang.NullPointerException
at Bomb.kill(Bomb.java:29)
at Bomb.explode(Bomb.java:22)
at Bomb.act(Bomb.java:16)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:288)
at greenfoot.core.Simulation.run(Simulation.java:158)
I'm getting that run-time error. for this code:
public void kill()
{
List<Enemy> enemies = (List<Enemy>)getWorld().getObjects(Enemy.class);
for (Enemy enemy : enemies) {
enemies.removeAll(enemies);
getWorld().modifyScore(enemies.size()*2);
}
}
The error just somehow changed...
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at Bomb.kill(Bomb.java:28)
at Bomb.explode(Bomb.java:21)
at Bomb.act(Bomb.java:15)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:288)
at greenfoot.core.Simulation.run(Simulation.java:158)
That's because you're trying to modify the contents of the list:
enemies.removeAll(enemies);
There you're trying to empty the list you've just formed, which isn't what you want to do (and why you're getting said exception). Instead you want to remove each object from the world:
getWorld().removeObject(enemy);
You need to be careful about what you're actually removing the object from!
HA! I don't know where my common sense was today... Why would I try to remove from the list instead of the WORLD. Sometimes I surprise myself with stupidity.
A new version of this scenario was uploaded on Sat May 02 02:47:33 UTC 2009
Well, since the spawning of the enemies is relative to the round number, I was wanting it to reset the round number every time a bomb is used, so the player isn't immediately overwhelmed again.
btw, i finally finished reformatting, so i can use my good pc...
Yeah, I tried that commenting that out and the same thing happens. I called it directly from the Enemy class, but it didn't change anything. It's supposed make it so only one enemy spawns after the bomb is used.
A new version of this scenario was uploaded on Mon May 04 18:29:01 UTC 2009
Nah it shouldn't, at least not how it's written at the moment ;)
Have a look at your kill method - you might be resetting it, but you're also spawning as many enemies as you're removing. Only one line that's in the loop should actually be in a loop, take the other two outside of it and it works.
A new version of this scenario was uploaded on Wed May 06 19:06:07 UTC 2009
2009/4/24
2009/4/24
2009/4/24
2009/4/25
2009/4/26
2009/4/30
2009/4/30
2009/4/30
2009/4/30
2009/4/30
2009/4/30
2009/5/1
2009/5/1
2009/5/1
2009/5/1
2009/5/1
2009/5/1
2009/5/1
2009/5/2
2009/5/2
2009/5/2
2009/5/2
2009/5/2
2009/5/2
2009/5/2
2009/5/3
2009/5/3
2009/5/4
2009/5/4
2009/5/6
2009/5/6
2009/5/7
2009/5/9
2009/5/9
2010/1/21