![]() ![]() In terms of formulas for part 3: int dx targetX - getX () int dy targetY - getY () double angle Math.toDegrees (Math.atan2 (dy, dx)) double distance Math. You can move some of it out later if you need to. TheExploration / Plants-Vs-Zombies mehanix / Blackout fiekzz / FlappyG7 GameGenesis / Greenfoot. This.getWorld().addObject(new Bullet(), this.getX(), this.getY()+60) Īnd the second question, how to I implement the animations smart? I want to have smooth transitions, and with instantly switching the files as soon as another key is pressed it becomes chopped up. At this stage, I think its ok to put most of the code into your Actor subclass. Here are 26 public repositories matching this topic. If (Greenfoot.isKeyDown("space") & shotTimer > 15) ![]() * Character that wants to shoot balloons using a slingshot. Being that your block locations are hard-coded with a y-coordinate of 384 and your blocks span the whole width of the world, you can start with 384 and subtract half the width of the block and also subtract half the width of the shroom to get the y-coordinate of where a shroom can go. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |