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

2013/11/25

Bullets start in the middle of thw world instead of where the actor is.

ewc0707 ewc0707

2013/11/25

#
When i fire at the enemy the bullets are added to the same spot every time. Also this location is in the middle of the world instead of where Steve is. I have a feeling this is because of my scrolling world but can't find a solution to the problem, any help would be great.
danpost danpost

2013/11/25

#
Please name the Scrolling world you are using and show the method with the spawning code.
ewc0707 ewc0707

2013/11/26

#
public void fire() { Bullet bullet = new Bullet(rotate); Sworld sworld = (Sworld) getWorld(); getWorld().addObject (bullet, getX(), getY()); bullet.move(); reloadDelayCount = 0; }
danpost danpost

2013/11/26

#
Replace 'getWorld()' in the 'addObject' line with 'sworld'.
You need to login to post a reply.