Delete after animation.

Stuck? This is the place to go to get and give help.

Delete after animation.

Postby Paul » April 11th, 2012, 6:33 pm

Hello,

I want when the player collides with an object, an other object is going to animate and when it reaches frame number 14 it deletes itself and the object where the player collided with.

Can someone please help me? Thanks.

Paul
Paul
 
Posts: 47
Joined: July 23rd, 2011, 3:21 pm

Re: Delete after animation.

Postby YoshiInAVoid » April 11th, 2012, 7:06 pm

If PA_GetSpriteAnimFrame(Screen, Sprite) == 14
Start Block
Set Object Y to 192
End Block
Sorry, Jack, YoshiInAVoid's back!

I'm the original; I'll take your breath away! This fall, YoshiInAVoid rules! Did you miss me, Andy? I sure missed you!

Keep an eye out for me.
YoshiInAVoid
 
Posts: 1985
Joined: December 30th, 2010, 11:53 am
Location: England

Re: Delete after animation.

Postby Paul » April 12th, 2012, 5:08 pm

Thanks but it doesn't work I get a lot of errors. In wich object I have to place it and with wich event?
Paul
 
Posts: 47
Joined: July 23rd, 2011, 3:21 pm

Re: Delete after animation.

Postby YoshiInAVoid » April 13th, 2012, 2:31 pm

Step Event. Change Screen and Sprite to your screen and sprite, EG:

If PA_GetSpriteAnimFrame(0, 2) == 14
Sorry, Jack, YoshiInAVoid's back!

I'm the original; I'll take your breath away! This fall, YoshiInAVoid rules! Did you miss me, Andy? I sure missed you!

Keep an eye out for me.
YoshiInAVoid
 
Posts: 1985
Joined: December 30th, 2010, 11:53 am
Location: England

Re: Delete after animation.

Postby Buck_7 » April 14th, 2012, 4:38 pm

Is it possible to set a variable to a sprites frame number?
Id on't want to do all those I object frame is-- There's way too many of them.
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 1002
Joined: February 19th, 2011, 1:44 am

Re: Delete after animation.

Postby Nobody » April 14th, 2012, 5:10 pm

Buck_7 wrote:Is it possible to set a variable to a sprites frame number?
Id on't want to do all those I object frame is-- There's way too many of them.

it is very possible. Frame numbers are just numerical values aren't they? So all you have to do to manually animate is to set the object frame to a variable. Use an alarm or some other variable to count the time in between each frame and then bump the frame variable to the next value after the interval. Once the variable reaches the last frame then set it back to the beginning.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1982
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Delete after animation.

Postby Buck_7 » April 14th, 2012, 5:55 pm

No, I think you may ahve read it wrong. I already know how to do what you've mantioned, but I'd like to set the variable to the sprite frame touched.(theree are many of the same object, just duplicated with different frames.
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 1002
Joined: February 19th, 2011, 1:44 am

Re: Delete after animation.

Postby Nobody » April 14th, 2012, 6:12 pm

i've never tried doing it from animating, but when it's not animating i know how to do it. So are you trying to get the frame number of object when it's animating or not animating upon touch?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082 (latest project!)
The Living Dead - viewtopic.php?f=13&t=1582
Mario Craft - viewtopic.php?f=8&t=1736 (Most Popular!)
Spawn Zombies - viewtopic.php?f=13&t=3444 (Newest)
User avatar
Nobody
 
Posts: 1982
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Delete after animation.

Postby YoshiInAVoid » April 14th, 2012, 9:05 pm

Buck_7 wrote:Is it possible to set a variable to a sprites frame number?
Id on't want to do all those I object frame is-- There's way too many of them.

You mean:

Set Variable Frame to PA_GetSprite...
Sorry, Jack, YoshiInAVoid's back!

I'm the original; I'll take your breath away! This fall, YoshiInAVoid rules! Did you miss me, Andy? I sure missed you!

Keep an eye out for me.
YoshiInAVoid
 
Posts: 1985
Joined: December 30th, 2010, 11:53 am
Location: England

Re: Delete after animation.

Postby Buck_7 » April 14th, 2012, 9:46 pm

Oh, I see what you're doing.

So...

If Stylus.Newpress
Start Block
Set Variable Frame to PA_GetSpriteAnimFrame (1,[Me])
End Block

Except it is only returning the first frame
...?
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 1002
Joined: February 19th, 2011, 1:44 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest