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

Report as inappropriate.

Tomfoolery
Tomfoolery presents ...

2012/12/9

Star Trek

Instructions:
WASD movement
spacebar fire torpedo
e fire energy pulse

You have five lives, and lose one whenever you collide with an enemy.
You can destroy asteroids.

2455 views / 12 in the last 7 days

1 vote | 0 in the last 7 days

Tags: asteroids space game star trek

Your browser does not support the canvas tag.
mikmik

2012/12/9

What - do you mean that when you turn, the spaceship stays fixed, and the whole world turns?
TomfooleryTomfoolery

2012/12/9

When the ship moves forwards, it stays centre of the screen. When it turns, the world stays still but when you move forwards again, it side scrolls. Would you have to put the WASD commands in the World class file?
mikmik

2012/12/9

You would put the WASD commands in all classes that you want to see move in the world (stars, enemy ships, asteroids, ...). The best way to do that would be to make a common superclass for all those classes (say, call it 'ScrollActor') and put the code there, then you don't have to write it three times. If you also have turning, though, then it gets a little more complex, because the new objects enter the screen at different places.
TomfooleryTomfoolery

2012/12/9

OK I think I understand. Is an alternative adding sectors? (so if you move to the very right of the screen, it enters a new world). Thanks!
Hi K├Âlling how are you? I need your help. I can't run my "Conway's game of lime". It looks that all codes are okay, but when I click to run, then it happens nothing. Please check that. This is the link for my scenerio. http://www.greenfoot.org/scenarios/6960
A new version of this scenario was uploaded on Mon Dec 10 21:37:08 UTC 2012 - press "e" to fire pulse gun. - you now have to collect the teddy bears in order to be able to shoot torpedoes (press spacebar). - press "q" to speed up. - more updates to come.
mikmik

2012/12/11

Nice work - this is getting better. Maybe next could be to actually display the lives and a score. You may like to have a look at this: http://blogs.kent.ac.uk/mik/2012/02/joc-16/
TomfooleryTomfoolery

2012/12/11

I have run into a really annoying problem. I tried to add damage levels to the asteroid, that failed and I tried to go back to how it was before, but i keep getting these errors in the Terminal Window: Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space the same thing again, then: java.lang.OutOfMemmoryError: Java heap space Do you know what the cause of this is?
rdv16jarirdv16jari

2013/3/9

Interesting, I think that it could be a lot better, if you could get the at World Edge and slow the enemy ships it could improve it quite nicely, I think I could be able to help, could you please release the source code?
rdv16jarirdv16jari

2013/4/2

could you please relaese the source code

See all comments

Want to leave a comment? You must first log in.

Who likes this?

mik