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

Pages: 1 2
Windows / Mac / Flash / HTML5 / [WIP] Dino's Adventure
« on: April 15, 2012, 11:54:34 am »
Hi guys! Some weeks after downloading StencylWorks I have managed to complete a proof of concept for my game.

First of all, I'd like to say thanks to all of you who helped me here at the Forums Section.

I'm really far of being a programmer, actually I'm pretty dumb for this kind of stuff, so I guess that it's better to start with something simple, and improve it while I learn more about Stencyl and game programming.

There's still much work to do, but every feedback and suggestions are welcome.

Playing as Dino, you must get rid of the swarm of bugs that are invading the screen. Stomp their heads and avoid being touched by them.

Here's the Game:

Ask a Question / Re: [Question] Enemy walk and collision problems.
« on: April 11, 2012, 07:02:31 pm »
Thanks guys! Problem solved. I choosed the first approach. It works really good.

Here's the code:

Now I have another question. Supposing that I have two spawning points. One at each side of the screen. How can I tell the enemy actor to invert its direction if it is created at the other side?

Ask a Question / [Question] Enemy walk and collision problems.
« on: April 10, 2012, 06:29:52 am »
Hi guys! Facing more difficulties with coding.  :-[

Working with enemies on my project, I'm struggling with two problems:

1) I want to develop a behavior that makes the enemies walk towards until it hits something (a wall for example) and then starts walking to the opposite direction.

At first I tried this: The enemy starts walking from left to right, at 5 speed. When it collides with the left side of something, it changes its direction. Similar thing if it happens with the right side of something.

It didn't worked. The enemy only keeps walking towards the wall.

Then, I tried something else: I could use the x coordinate to tell when the enemy must change it's direction. So I tried this:

It's pretty wrong, because when the enemy reaches the coordinate, it creates a conflct with the other part of the code. But I don't know what to do.

2) I created a stage behavior that creates a new enemy every 5 seconds. It creates in mid-air, but it not collides with the groud. it passes right through the tiles. Curious fact. If I put an enemy at the stage editor it's collision works perfectly, he starts at mid-air then lands on the tiles perfectly.

I'd like to ask for some orientation. If you guys could do this for me I'd be very thankful.

Tested the code that Abigayl suggested and worked pretty well. Thanks for the help!  :D

I'm guessing based on your coding that your scene has gravity... if that is the case, when the actor goes off screen, there are no tiles to hold him up, so he falls down, below the point where he can come back onto the screen. One way to test this would be to go to the edge, almost to falling off, then jump off and try to come back (assuming you can jump long enough). If you can see him return, that's your issue.

I just tested. That's exactly the problem!

So, the solution would be an invisible tile blocking the way? Or there is a more clever way to do it? Heheheh.

Thanks Abigayl!

Screenshot of the behavior? How do you know that it's not always simulating?

Sure, I had to have posted it earlier. sorry.

When the character goes off-screen it doesn't come back.

Thanks for the help!

Do you attach the behavior to the actor?

Yes I did.

Hi guys, sorry to bother with this, but I'm facing problems with the "Make (Self) Always Simulate" piece.

I tried do put it under the "When created", but it doesn't work. The same thing if I put it under the "Always" block.

I don't know what to do now. It should be simple, but I don't know what's happening, hahah.

Resolved Questions / Re: Please help
« on: March 30, 2012, 06:46:31 am »
Did you altered the hit boxes of the tiles?

Could you post a print of your code?

Resolved Questions / Re: [Question] How to develop a "Jump" Behavior
« on: March 30, 2012, 05:54:53 am »
if you want the character to stay alive if it leaves the screen, just put in the "always simulate" block somewhere.

I tried to do it. I've put the "always simulate" inside "when created" and inside "always" blocks, but it doesn't work =/

Resolved Questions / Re: [Question] How to develop a "Jump" Behavior
« on: March 29, 2012, 08:16:36 pm »
nice work. good to see the if walking irght and right side is hitting a tile set x spee to zero thing worked, I ahdn't actually tested it yet, but I was pretty sure it would.

when can we see a demo uploaded to stencyl ;)

Thanks bro! The basic movement mechanic is finally done, and working pretty fine in my opinion. Maybe it needs a fewk tweaks in walking speed.

Now I'm designing an enemy sprite and doing some research in background designs. The next programming steps are: developing a simple behavior for an enemy, creating a "game over" condition, and a "stomp on enemy" behavior. There's also an urgent matter of the character disappear when it goes out of screen boundaries.

For those who are interested in seeing the results of my progress, here is the link for the demo:

Use arrows to move, and "Z" to jump.

Question: what is a reasonable size for a game? My demo have already 700kb.  :o

Resolved Questions / Re: [Question] How to develop a "Jump" Behavior
« on: March 29, 2012, 03:46:28 am »
Well, I think now the problem is finally solved. I'd like to thank you all who helped me on this. twotiming pete, abygail, zeljko46, captaincomic, mzxstosch, SWATLLAMA and whoever I forgot to mention!  :D

I was able to make the character continue his jump towards when he gets higher than an obstacle.

The final code is this:

If you guys know have suggestions for a simpler and cleaner way to code this, I'd really like to hear suggestions.  :)

Resolved Questions / Re: [Question] How to develop a "Jump" Behavior
« on: March 28, 2012, 01:49:52 pm »
Hi everyone!

It seems like I finished the first step of my project. My character can effectively walk and jump by now.

zeljko46 and twotimingpete, thanks for helping me solving the collision and multiple jumping issues

The only remaining issue is that I can't jump towards when I'm touching a wall. For example, the character is facing a wall who have the same height, and it can jump 3x his height. But, if I jump towards, being in a higher point than the wall, I can't make it through the space above it.

I don't remember right now if this is possible in platforms like Super Mario Bros. or Mega Man (shame on me, I know, but I think it is possible.), but it makes sense, although it feels weird.

Here's the code I worked on so far:

Thanks to all of you who kindly helped me.  :)

Resolved Questions / Re: [Question] How to develop a "Jump" Behavior
« on: March 27, 2012, 04:12:52 am »
Hi everyone!

First of all I'd like to thank all of you for helping me. I got pretty substancial improvements since my last post.

At first I tried this code below. If I was planning to do a Jetpack game, I would be pretty satisfied by now :P Don't know if it's a reliable code, but I saved it anyway for later usage.

But that wouldn't solve my problem, so I borrowed some things from the code posted by twotimingpete and from captaincomic's post. (And payed attention to what Abigayl said before :P) Here's the result:

But I still have a problem.

As you can see above, I created a quick scene to test the character's movements. But the problem is: When he jumps and collides with a wall, if the "Left" or "Right" Buttons are pressed, he will keep walking in mid air, like he's sticked to the wall.

Because of it i created 2 other conditionals under "When this collides..." block, but I didn't figure yet how to solve this. If I release the button, the expected action happens; the character slides down the wall until reach the ground. But I don't know exactly how to provoke this without blocking the directional inputs.  :(

Here's what I tried.

But when the character touches the wall while in the air, he can't walk anymore. I'm facing some difficulties in figure how I can make him able to walk again as soon as he touches the ground again.

Other problem that I found is that the character is able do make multiple jumps. I'm trying to solve both of these matters right now, but I'm facing a hard time with them.

Do you guys have some suggestions to solve these problems?

Thanks in advance!

Resolved Questions / Re: [Question] How to develop a "Jump" Behavior
« on: March 24, 2012, 04:54:16 am »
Hi guys, I tried to follow what you suggested me. Got an improvement, but it's a bit weird.

What I did:

-Set up the scene's gravity by 50

-Did some changes in the code, following your suggestions and trying some other things

The result was: The character still move upwards as long as I keep the jump button pressed, and when I release it, the character is slowly pulled down by gravity.

Now I'm a bit lost. Don't know exactly what to try.

Thanks in advance.  :)

Pages: 1 2