side scrolling problem

arnie30uk

  • Posts: 10
Hi there, i am very new to stencyl and im hoping the problem i have is a simple one and any help would be much appreciated.
In  a nutshell im just making a test level to see how i get on with stencyl.  Im attempting to make a side scroller, the scene is 3 times wider than the default, i have used tiles and the actor mambo from stencyl forge. Now where im having the problem is that as soon as the camera scrolls with the actor, i lose all collision detection with tiles further down the screen and i just fall straight through them. i Have tried turning on continuous collision detetcion in both the scene and the actors own properties. I have also tried adding a "when created event enable continuous collision detection" to both the actor and the scenes events tab. I have tried all of the above individually and all at the same time too and no combination of either is helping me.  Any help would be great as untill i get this  fixed i have no chance of even making a simple side scroller.
Thanks very much in advance

squeeb

  • Posts: 1617
Continuous collision isn't the answer.. turn on debug draw and then you can see the Collison shapes and see what's happening... I forget where up top in the menu of stencyl it's at... run>> debug draw maybe.. it's there with turn on fps monitor

arnie30uk

  • Posts: 10
Cool thanks for answering, will do as you suggest and see what that turns up. Thanks again

arnie30uk

  • Posts: 10
Big help already thank you, it seems the problem is when the camera follows the actor. As soon as the screen scrolls, the white box representing my characters collision gets left behind slightly so that the actors collision doesnt line up with the sprite if that makes sense. Not sure how to fix it but at least i now know where the issue lies. Thanks for the swift and very helpful advice

arnie30uk

  • Posts: 10
I've attached a couple of pics of the issue im having, when i turned on the debug draw as suggested it shows this issue. In the first pic you can see the actors collision box surrounds the sprite, it also follows the character no problem too but as soon as the scene needs to scroll the sprite seems to run ahead of the collision box as you can see in the second pic and i have no clue as to how to keep the sprite locked to the collision box during scrolling. Thanks in advance for any help you may be able to provide

squeeb

  • Posts: 1617
Oh weird! Glad we're on the right path.. Ive never seen that before.. I'm sure someone has haha.. are you using the collisions in the actor animations? Or are you creating collisions with code?

arnie30uk

  • Posts: 10
lol does seem an interesting problem i must admit. Im not creating any coded collisions so will have to say im using collisions in the actor

squeeb

  • Posts: 1617
check collision shapes in the animations section maybe?
you could always send me what you have and i can see whats up with it...file>> export game ...to a .stencyl file and email
swarnerauto1@yahoo.com

arnie30uk

  • Posts: 10
Ok cool thank you will check collision shapes and if no luck will send you over the file. Many thanks for your help


CJ8706

  • Posts: 9
I believe your having a similar problem as me.
The easy way to fix this is, go to the Scene Creation (now your scene is 3 times the size as normal I would break that into 3 scenes).

Now take Scene 1 (first part of your scene after you break it apart), than go into the creation, you will see a "Create region" on the left hand bar, do this on the right side of the  scene in whatever shape you want.
Than go to the Scene Event and code.
You need to go to "When specific character enters/exits region" than the when updating will show up.
Than you add the when the region is entered switch to Scene x (in your case Scene 2 (The 2nd part of your split scene).
Than add the part that recreates your hero at the beginning of the scene.

Repeat for Scene 2 so you can transfer to scene 3


I believe this is the easiest way to do the side scroller that you want. I did it and it works pretty well.
If I am not understanding what your saying please let me know

Hope this helps

arnie30uk

  • Posts: 10
thanks for the advice cj8706 i shall give this a try and see how i get on with that. Thanks to everyone who has helped, good to be part of such a friendly and helpfull community

CJ8706

  • Posts: 9
Your welcome glad to be of help