The Daily Click ::. Forums ::. Klik Coding Help ::. Invisible force field, hit, plays visible animation
 

Post Reply  Post Oekaki 
 

Posted By Message

Dean Avanti



Registered
  01/11/2006
Points
  130
17th September, 2007 at 12:32:32 -

The force field is invisible, it only works if hit by a ball. when hit it plays an animation of lightning.

I made an active object, I imported the animation frames for the lightning under a new animation. I think as default it calls it animation 12, but you can re name them if wanted, I changed it to force field, for the stopped animation its just a giff image with a line on to give the ball something to hit. Only this is set to invisible, I want the ball to play the animation of the force field lightning when it hits the stopped image, that is invisible of course, its only their to give the ball something to hit.

So how do I make animations play when something happens, its not to clear like, when this does this, play animation, then it asks you which one to play from a list of available.

What can I do, also, did I do right by having an image for the force field but in visible at start in its properties I don't tick it. I need something for the ball to hit right? but I don't want that visible, I only want the animation of the lightning field to be visible once the ball has hit the force filed area, place, object, you know the invisible object I stuck in to give it something to hit.



 
http://www.avantivita.com
Video game developers and home of video game development assets.

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
17th September, 2007 at 12:44:21 -

The ball will still detect collisions with an invisible object. So you can have it START invisible.


Then, open up the "event editor"
In here, on the left side of the screen, create an event under "Add new condition"
Set it to "collision between BALL and FORCE FIELD"

Then, look where that line on the grid intersects the line going vertically below the "force field object"

Click on that empty space, and add this event:
*Play animation 12
*Make object visible.

You can find these under:
Forcefield Object---> Animations ---> Change Animation Sequence (then it pops up, and asks you which one to choose)
And
Forcefield Object---> Visibility ---> Make Object Reappear.




Now, that will make it only work once. You'll quickly find that it will stay visible, which is a problem. So add this next line of code:


On the right column, add an event:

*Force field's animation 12 is finished playing
(find this by right clicking on the force field icon, and bringing up Animations---> Animation has finished playing?)

Then add these events inside the grid:

*Change Animation Sequence to STOPPED
*Make Object Invisible


You'll find those 2 commands in the same places as before.


You can also add any effects to your ball you want, in that same event for the collision.
For example, you can add a "Bounce" command in the grid under where the ball is located. This will make it bounce when it hits the forcefield.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
17th September, 2007 at 12:59:33 -

You actually use the event editor? I could never stand that thing - it makes it so much harder to see what you're doing and spot mistakes (with the order of actions especially). If you have loads of objects it's even worse.

I like the event list much better

 
n/a

Dean Avanti



Registered
  01/11/2006
Points
  130
17th September, 2007 at 17:30:57 -

It works, but the ball sometimes pases through the force field, its the act of changing its graphic that messes something up, if its just hit this bounce, fine, but on this as its hitting something then showing a graphic it must upset something, perhaps its better to do hit this bounce, then if ball is over barrier play animation of another object at that place, Im not sure, I just know that the ball is passing through the barries sometimes, also sometimes the animations of the electric are sometimes staying on and not disapearing, its rare but it looks very bad when it does it. So its seems this way isnt perfect.

 
http://www.avantivita.com
Video game developers and home of video game development assets.

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
17th September, 2007 at 18:39:14 -

Try this.
*Ball hits barrier
+Animation Stopped is playing
>Bounce ball.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Dean Avanti



Registered
  01/11/2006
Points
  130
17th September, 2007 at 18:55:43 -

+Animation Stopped is playing
>Bounce ball.

How do I do that, whats that under.

Do you mean this, collision between ball and force field ------- ball bounce, change animation to stopped.

that didnt work, Ill of done what you said wrong I think.

Just did some more testing with my original method, the ball goes through the force field most of the time, like 90%.

Image Edited by the Author.

 
http://www.avantivita.com
Video game developers and home of video game development assets.

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
17th September, 2007 at 19:07:21 -

Bouncing ball collides with barrier
AND barrier stopped animation is playing
THEN bounce the ball.

I can't help you with where they are because I don't have something to look at. Perhaps some nice clikker will come along and help .

As for the animation not going away, it'd be better to have the animation set to always loop, and go about this method:

+animation 12 is playing
>add 1 to alternate value A (barrier)

Alternate value A is > 10 (or whatever number)
>set alternate value A to 0
>change animation of barrier to stopped.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Dean Avanti



Registered
  01/11/2006
Points
  130
18th September, 2007 at 00:24:57 -

Bouncing ball collides with barrier
AND barrier stopped animation is playing
THEN bounce the ball.

barrier and electric animation is all one object,

lets call the object electro.

stopped animation is just a line on a blank background.
animation 12 is the animated electric effect.
so barrier stopped animation is always playing, well its not an animation as its one frame.

So im not sure what you mean here.


 
http://www.avantivita.com
Video game developers and home of video game development assets.

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
18th September, 2007 at 00:41:40 -

Uh, perhaps you need to make it wider then just a line?

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Dean Avanti



Registered
  01/11/2006
Points
  130
18th September, 2007 at 11:41:11 -

At the moment is a line that is 16 pixels wide.
See an example file here.

89k file
http://www.avantivita.com/Dean/ErrorBall.zip

the ball goes though the barriers, and sometimes the animation plays the force field and the animation will stick on the last frame and leave it on screen, very ugly.

Image Edited by the Author.

 
http://www.avantivita.com
Video game developers and home of video game development assets.

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
27th September, 2007 at 15:38:06 -

Ok i have downloaded the file and fixed your problem. Firstly delet ALL the code in the event editor and replace it with the following:

Step 1:
Create a new condition which says:
Ball leaves play area on top, right or bottom then bounce ball.

Step 2:
Create another condition which says:
If there is a collision between ball and electro whilst electro is invisible then:
(do this in this order very important)
Bounce ball
make Electro reappear
Change animation sequence to activated

Step 3:
Animation activated is finished:
Change animation to stoppped
Make electro invisible.


There you have it. finished. also just a quick note. check your hot spot and action points as they dont appear quite right.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click