-1

I want to write a code to make a fairy fly all around screen in java/scala, like when tinker bell moves, only my game is 2D so no need for z attribute.

I sound very lazy to ask this but can anyone refer/write me some code to start with? I suck at math :( I really need some basic code or tutorial to begin with.

Ozzy
  • 8,244
  • 7
  • 55
  • 95
Elonoa
  • 467
  • 7
  • 19
  • 3
    Even if someone does do your work for you and writes code that you put into a game that you would call your own, it might be beneficial in the long run to read up on some math in order to do these things by yourself. If you suck at something, teach yourself! :) – Victor Zamanian Apr 14 '12 at 23:41

1 Answers1

1

You might want to work out a path you want her to take first (on paper)... Drawing out a motion line first will help you to start programming it.

Then you could be clever a work out some equations e.g. y = ax2 + bx + c for her to follow, or you could just hardcode the key points in her path and then create a function to make her travel through an array of key points (x and y co-ordinates).

Ozzy
  • 8,244
  • 7
  • 55
  • 95