Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - captaincomic

Pages: 1 ... 238 239 240 241
Ask a Question / Re: Recycle when Off Screen Problem
« on: November 29, 2011, 02:01:35 pm »
I have to reply once more to myself :)

Thinking about it once more, actor.isOnScreen() seems pretty unusable for me now.
When you do the following
Code: [Select]
if (!actor.isOnScreen())
it will actually mean that the actor would be recycled while still visible (if leaving to the top or left). I never noticed as my bullets move too fast, but if you use this for something big or slow it will just disappear immediately when it touches the screen edge.
Why doesn't actor.isOnScreen() check if the actor is completly off screen? Is this (really) a performance issue?
I can do the check manually, I'm just wondering ;)

Ask a Question / Re: Recycle when Off Screen Problem
« on: November 29, 2011, 01:00:48 pm »
Ok, I played around with offscreen bounds and debug drawing: actor.isOnScreen() is true as long as the top left pixel is on screen. An actor stops simulating when more than the half is off screen.

Well, I just have to remember to use "always simulate" whenever I check actor.isOnScreen.

Ask a Question / Re: Recycle when Off Screen Problem
« on: November 29, 2011, 09:57:24 am »
Ok, thank you, I start to understand whats happening.

So when exactly does actor.isOnScreen() evaluate to true/false?
I would make sense if an "simulating" and actor.isOnScreen() would be consistent, i.e. an actor stops simulating if and only if actor.isOnScreen() is false. But it seems that's not the case(?)

Ask a Question / Re: Recycle when Off Screen Problem
« on: November 29, 2011, 09:19:06 am »
Ok. Making "always simulate" default sounds good, I'd say for beginners its better to have bad performance than to have an unexpected behavior.
Still I'm surprised that the "when off screen"-behavior executes when the bullet leaves to the top or to the left even without "always simulate". Any idea why that happens?

Ask a Question / Recycle when Off Screen Problem
« on: November 29, 2011, 06:13:00 am »

I have noticed something strange.
I have a beahvior to recycle bullets when they go off screen. When a bullet leaves the screen over the top edge or the left edge it gets recycled correctly, but when it leaves the screen over the bottom edge or the right edge it doesn't get recycled. It just disappears with and no code under
Code: [Select]
if (!(actor.isOnScreen())) gets executed.
I set the offscreen bounds to negative values to see whats happening and I print messages in the "Die When Off Screen"-behavior.
The bullets disappear on each side, but the messages only get printed if it leaves top or left.

If I use "always simulate" for the bullet, everything works as expected, the messages get printed
whenever the bullet leaves the offscreen bounds (no matter which direction).

So using "always simulate" is a workaround, but this behavior is still strange, isn't it?

Shared Resources / Re: Eye Candy Pack (update)
« on: November 25, 2011, 05:26:04 am »
Glad you like it :)

Shared Resources / Re: Eye candy pack
« on: November 25, 2011, 01:08:13 am »
I finished the example "game", it's up on Stencylforge as Eye Candy Pack Showcase.  Making the showcase also helped me finding some bugs and I added new features to the resource pack. Check it out ;)

Actually my dummy actor solution made more problems than it solved, so in the end I went with the scene behavior. I updated the Eye Candy Pack and added an example Eye Candy Pack Showcase ;)

Ok, doing it with a dummy actor was easy. It's not the most elegant solution, but for now, its ok. :) Maybe l try to do the other thing later.

Ah ok, thank you both!

I didn't know you could just use a closing bracket to end the drawing block :)

I will try if I can get it to work with a dummy actor or a scene behavior...

I created a behavior for the Drop Shadow Filter (flash.filters.DropShadowFilter), it's on StencylForge in the Eye Candy Pack.
The problem is the shadow gets drawn on the same layer as the actor, and therefore it gets drawn over other actors.

Is it possible to draw on a specific layer in an Actor Behavior using a Code Block in Design Mode?

I found, but it says it only applies to Scene Behaviors and also you need to override a function, which is not possible in Design Mode.

Thanks :)

Shared Resources / Re: Eye candy pack
« on: November 22, 2011, 06:23:07 am »
Good idea, I will do that. But I think I will rather make a simple GUI-thingy than a game. I think that way it's easier to show all the effects...

Shared Resources / Re: Exploding Actor Resource Pack
« on: November 21, 2011, 03:43:15 am »
This behavior is really nice! :)

For your info: I converted it to Design mode (with blocks) and modified ut a little. You can set a custom actor type now and the copying of pixels is optional (if you turn it off the actor will explode into actors of the chosen type). You can find it on Forge in the "Eye Candy pack".

Shared Resources / Eye Candy Pack (Stencyl 2.x)
« on: November 21, 2011, 02:45:26 am »
I put together my first resource pack with behaviors written from sratch or adapted from resources found on Forge.

EDIT: Updated description
== captaincomic's comprehensive eye candy pack v1.1 ==

Includes various effects for actors and scenes:

* Apply Effect
(make grayscale, make negative, make sepia, tint, adjust hue, set saturation, adjust brightness)

* Bevel, Blur, Displacement, Drop Shadow, Glow, Screen Displacement, Screen Blur
(uses of various subclasses of flash.filter.BitmapFilter, based on "Glow Filter" by Alexin, converted to Design Mode, added custom Trigger)

* Explode to Fragments
(based on "Exploding Actor" by coleislazy, translated from Code Mode to Design Mode, added custom Trigger)

* Explode to Actors of Type

* Fade, Grow

* Screen Flash
(draw a rectangle covering the screen with custom blend mode, opacity and color)

* Switch Animation

* Switch Scene, Reload Scene
(fade out/in with custom color)

* Update Shadow with Lightsource
(used to change the angle and distance of the Drop Shadow behavior, based on a lightsource actor)

== Instructions ==

1) Many behaviors include a Trigger attribute and a Disable Trigger attribute:

Use the
"tell (Actor) to (Trigger/Disable Trigger) for all behaviors"-block
or the
"tell (Actor) to (Trigger/Disable Trigger) for (Behavior)"-block
to enable/disable the actor effects

Use the
"tell this scene to (Trigger/Disable Trigger) for all behaviors"-block
or the
"tell this scene to (Trigger/Disable Trigger) for (Behavior)"-block
to enable/disable the scene effects

2) Many effects include a Permanent attribute and a Duration attribute:
if you set Permanent to true the effect will stay forever and Duration will be ignored, otherwise the effect ends after Duration seconds

3) Look here
under subclasses for information about the attributes of Bevel, Blur, Displacement, Drop Shadow, Glow, Screen Displacement, Screen Blur

4) The Drop Shadow behavior draws the shadow to the same layer as the actor by default. If you want the shadows to be drawn on a layer in the back:
* set the Use Shadow Manager attribute for all Drop Shadow behaviors to true
* create a layer in the back called Shadow Layer
* add the Shadow Manager Behavior to the scene

5) I hope any other attributes are self-explanatory :)

6) Check out the Eye Candy Pack Showcase on StencylForge for an example game (but it's not a game ;))

7) The Effects based on flash.filters.* can be quite performance heavy, especially the screen effects. Use the effects sparingly and make sure not too many effects are enabled at the same time. don't use them for a permanent animation (use an animation instead)

Ask a Question / Re: Filtering mouse input events
« on: November 18, 2011, 11:00:22 am »
Ah, ok, I thought you wanted to create an event when you click the mouse while the mouse is over the actors.

To cycle through all actors, would it be possible to create a region that covers the whole scene, and then use the "for each actor inside region _" block?

Pages: 1 ... 238 239 240 241