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

2015/6/23

Scripting?

SaxOps1 SaxOps1

2015/6/23

#
Hey, I'm making the game "1942", and I'm wondering how I might script the enemy planes to come in, fire, do a loop, fire, and be removed from the world. Any help with how I might script that? Not looking for solutions, just what I might do. Thanks!
danpost danpost

2015/6/23

#
I would use a smooth moving system and control the turn rate and turn acceleration using fields. Their values along with the current rotation and/or location can be used to determine when to fire and when to change the value of the fields to do the actions you want. Code it one step at a time. Place the enemy plane into the world and get first part of the flight going. When it gets to a point where you want it to do something (fire or get removed) or fly differently, stop the scenario and get the current rotation and/or location so you can use them in the next if condition to start the next phase of its flight. Continue in like manner until done.
SaxOps1 SaxOps1

2015/6/24

#
Thanks!
danpost danpost

2015/6/26

#
SaxOps1 wrote...
Hey, I'm making the game "1942", and I'm wondering how I might script the enemy planes to come in, fire, do a loop, fire, and be removed from the world.
How are you coming along with this? Have you come up with a working model, yet?
You need to login to post a reply.