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 - rright0102

Pages: 1
My initial experience with the Crash Course was about a week go with 2.2. This morning I loaded 3.0 that same example did not work right.  I was seeing the ship destroyed, but the last bullet stayed behind on the screen. It is stopped (due to physics)

I suspect, but am not sure, that all collisions are not detected instantly. So if one object detects a collision 1st and is destroyed immediately, the other object may not get a chance to detect that collision. The order in which detection is done may not be the same for all objects. So sometimes the ship gets destroyed other times the bullet.

Adding a delay to ALL objects seems to fix this for me. Do after .01 seconds kill self on the bullet. and a .1 on the ship. One thing I think you need to be cautious of is not to delay too long otherwise multiple collisions can occur. So if the frame rate is 60 frames per second, a timer of .01 should just catch one cycle. The reason you want the timer longer on the alien ship is so that the flash effect and sound have a chance to finish.

If you have a timer of .1 on the bullet and you are counting Hit Points then you will have had multiple collisions between the objects as several screen update cycles go by before the object is actually killed. The HP value will decrement multiple times and you will wind up with one shot kills.

So on bullet I have:
when self hits  member of enemies
do after .01 seconds
kill self

on enemy ship:
Created event:
When created
set hp to 3

Actor group event:
when self hits a member of bullet group
decrement hp by 1
apply effect make negative to self
do after .1 seconds
remove all effects from self

Updated event:
if hp < 1
play explosion
do after .1 seconds
kill self

I had the very same problem. My bullet would hit an alien and be destroyed, but the alien stayed. Check your game settings.

Click Settings Icon. Click Groups. Then go through your groups and make sure that Collides With is set to the group you want to detect collision with.

Chit-Chat / Re: Introduce Yourself!
« on: February 25, 2014, 05:45:18 pm »
Hi Everyone,

My name is Rob and I'm a Stencylholic. Just kidding, it can't be an obsession if you've been doing it for 2 weeks, right?

I've been a programmer professionally since '87, more than 1/2 my life. Mostly Cobol and CSP, procedural languages. Though I eventually learned object oriented programming, I never got to practice them much. Moved into databases and SQL. My background is business but I feel like I have a few games inside me that need to come out.

So I got Stencyl 2.2 and was teetering if I wanted to commit to it or another game engine, seeing as 3 was around the corner and then 3 showed up. Can't tell if 3 is much different than 2.2 as I didn't delve in beyond the crash courses. But here I am frustrating myself over the little details. With procedural languages, any problem you encountered was usually in the vicinity of whatever piece of code was not working. With Stencyl the issue could be in one of many places. When I couldn't get collisions working in Crash Course 2, I almost gave up. Then after I slept on it I realized that my setting for who collides with who were wrong.
I have a lot to learn, but I am enjoying it so far. Hope to create some content to share with the group.

My short term goal is to enter something to the Stencyl Jam and I've started to experiment with the tool on my own. I really like the physics, collisions and how I was able to implement movement and controls for my object. Now to give it some depth of play ...

Ask a Question / Re: painting on backgrounds
« on: February 24, 2014, 10:07:42 pm »
Actually what I was looking to do was make a game where you ride a lawnmower and any grass you mow changes to a different shade of green. Just for esthetics.

Extensions / Re: All-In-One Boolean Blocks
« on: February 24, 2014, 10:03:56 pm »
Hi Guys,

Nice extensions. I'm just starting to learn Stencyl and some of these things have been very frustrating especially having to move blocks in and out just to change a < to a >.

So here is a request for some useful functions.
1. increment/decrement value by amount with limit ( so when a limit is reached or exceeded the value will stay at the limit)
2. check a within b of c (return a true or false if a >= b-c and a <=b+c, would be useful for inexact comparisons)
3. toggle a Boolean value (if a = true then a = false else a=true)
4. return the velocity of an object (square root (xspeed^2 + yspeed^2))

Thanks in advance, I will have to explore creating my own extensions eventually. Right now just learning the core.

Ask a Question / painting on backgrounds
« on: February 24, 2014, 12:31:49 pm »
Is there a way to alter a bitmap at runtime? I want to paint splotches on the background as items are destroyed. I don't want to drop sprites all over as it would slow the game down.

Archives / Text Entry for Programming Blocks
« on: February 18, 2014, 01:21:30 pm »
It would be nice to have a text line that converts a programming block to text and vice versa a line at a time, so it can be edited without drag and drop. Drag and drop is great, but can take a long time to find the block to use.

If self hp < 0 then
changing to
if self hp <= 0 then

would be much faster by typing than by draging in a new math comparison block and draging values in and out

Pages: 1