asteroid animation/A.I.

Non-platform specific questions.

asteroid animation/A.I.

Postby praaab » Thu Feb 16, 2012 2:06 am

i want my asteroid to rotate slowly (like an animation but using code) and towards me (the spaceship), but i after it passes me it has to just keep going and not to continously follow me. I really need help and i have no idea how to do this.
praaab
 
Posts: 82
Joined: Sat Jun 18, 2011 2:14 pm
Score: 1 Give a positive score

Re: asteroid animation/A.I.

Postby skydereign » Thu Feb 16, 2012 2:21 am

How do you mean follow you? It sounds like you want the asteroid to spin (so rotated frames) but it also sounds like you are dealing with trajectories. What is making the asteroid follow you? If you want the asteroid to move toward you while spinning, but when it passes you to stop, you can add something like this (it assumes asteroids are coming from above the player).
asteroid -> Create Actor -> Script Editor
Code: Select all
directional_velocity=3;


asteroid -> Draw Actor -> Script Editor
Code: Select all
if(y<player.y)
{
    angle=direction(x, y, player.x, player.y);
}


If though you didn't want the asteroids to home on the player, than you can just put the angle code in the asteroids create actor. As for the rotation, from what you've given using an animation should work.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: asteroid animation/A.I.

Postby praaab » Thu Feb 16, 2012 10:02 pm

Thanks for the help but is there any way to make the asteroid rotate in its place without animation, Just code?
praaab
 
Posts: 82
Joined: Sat Jun 18, 2011 2:14 pm
Score: 1 Give a positive score

Re: asteroid animation/A.I.

Postby skydereign » Thu Feb 16, 2012 10:28 pm

Essentially no. You'd either have to use the canvas (this could be pretty slow), or wait for the gE 1.5 which supports rotation. But if your concern is having to rotate the animations yourself (instead of the increase in size of your game) there are plenty of ways to automatically rotate your images for you.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: asteroid animation/A.I.

Postby praaab » Fri Feb 17, 2012 8:36 pm

Im useing gimp for the rotation animation but wats a good way to make a smooth rotating ani
matiion?
praaab
 
Posts: 82
Joined: Sat Jun 18, 2011 2:14 pm
Score: 1 Give a positive score

Re: asteroid animation/A.I.

Postby skydereign » Fri Feb 17, 2012 8:40 pm

Ah, well with gimp if you want to do rotations, I'd recommend creating the image twice its size. Then rotate it, and scale it down. It makes the whole thing seem smoother. Though you can also make the base image and then use DST's sprite rotater, and then scale it down. It should net the same effect. http://game-editor.com/forum/viewtopic.php?f=1&t=9418&p=65281
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: asteroid animation/A.I.

Postby praaab » Sat Feb 18, 2012 5:54 pm

thanks for your help +1 for u
praaab
 
Posts: 82
Joined: Sat Jun 18, 2011 2:14 pm
Score: 1 Give a positive score

Re: asteroid animation/A.I.

Postby Clokio » Mon Feb 20, 2012 9:26 pm

I propose anime studio, you import your png, then you do a animation of rotation. Then you export it. Then with LS maker you get each frames. And with paint.net or gimp or else, you remove the background to make it transparent.
You can export frame by frame with the pro version.
In GE when you want a rotation you start the animation.

The advantage is that you would be able to adjust the speed of the rotation compared to gimp or other that you will have to calculate it yourselves. :mrgreen:
Clokio
 
Posts: 229
Joined: Tue May 17, 2011 2:18 pm
Score: 32 Give a positive score

Re: asteroid animation/A.I.

Postby tintran » Thu Feb 23, 2012 3:13 am

since you're already using GIMP, why don't you give this plugin a try?
i wrote it myself when i wanted to quickly rotate an image into a horizontal image of 36 frames for example and didn't want to manually rotate each frame in GIMP.
it's here http://tinyurl.com/6no2tdr
to quickly have an image of 36(or whatever the number of frames) i just using Rotate Tile and then Horizontal Stitch.
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest