Thanks! Like I said though, it's not done yet. Also, I normally leave sound on my computer off, so sometimes I forget about it. I'll try to add sound to the next version, thanks for the feedback!
i know this is bad and a little rude but do you mind if i can take a look at your code for the bullet and the cannon... just the bits that show how you get the rotation as for some reason i can get the bullets to fire but they only travel 1 way and when i fly the rocket the other way i would like the bullets to fire in the same direction...
sorry if you would rather not, it's not a prob:)
Sure, I'll re-upload it with open source.
The way I did that though was with a constructor, the bullet class looks something like this:
public class Bullet extends Actor
{
public Bullet(int dir) {
setRotation(dir);
}
public void act()
{
move(5);
}
}
Then, when I create the bullet I do it like this:
getWorld().addObject(new Bullet(getRotation()), getX(), getY());
When you create a constructor for a class, whenever you create a new class, you need to pass in the variable. Here's an example not in greenfoot:
public class myPrint
{
public myPrint(string whatToPrint) {
print(whatToPrint);
}
}
Then I'd do:
new myPrint("TestPrint")
and by passing in the string "TestPrint", the object myPrint would set its variable whatToPrint to "TestPrint"
It's sortof a difficult concept to grasp, I hope I explained it well.
A new version of this scenario was uploaded on Fri Nov 08 00:52:36 UTC 2013
Added Source Code
awsome thanks alot. this helped alot thank you very much :)
A new version of this scenario was uploaded on Mon Nov 11 22:15:30 UTC 2013
Added Scoreboard and made minor tweaks.
I'm still testing the scoreboard, and I know it's not perfect yet.
A new version of this scenario was uploaded on Mon Nov 11 22:17:23 UTC 2013
Forgot to remove some stuff
A new version of this scenario was uploaded on Mon Nov 11 22:18:03 UTC 2013
A new version of this scenario was uploaded on Thu Nov 14 22:59:14 UTC 2013
Minor bug fixes
Planned Features:
Health Bar
Main Menu
Upgrade Menu
Harder Tanks
A new version of this scenario was uploaded on Thu Nov 14 23:05:10 UTC 2013
Removed Adminmode
A new version of this scenario was uploaded on Fri Nov 15 01:02:02 UTC 2013
Small Additions; mouse now is replaced with a target
A new version of this scenario was uploaded on Fri Nov 15 21:43:05 UTC 2013
Fixed major bug allowing you to get infinite score
Am I the only one getting the exceptions when the scenario is running? :
java.lang.IndexOutOfBoundsException: invalid hotSpot
at sun.lwawt.macosx.CCustomCursor.<init>(CCustomCursor.java:83)
at sun.lwawt.macosx.LWCToolkit.createCustomCursor(LWCToolkit.java:239)
at FightWorld.changeMouseImage(FightWorld.java:68)
at FightWorld.<init>(FightWorld.java:24)
And the following repeated:
Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
at greenfoot.WorldVisitor.toCellFloor(WorldVisitor.java:86)
2013/11/7
2013/11/7
2013/11/7
2013/11/7
2013/11/8
2013/11/8
2013/11/8
2013/11/21
2013/11/23
2013/11/23