Sliding actor to screen, then it starts lagging.

chongyunxiang

  • Posts: 216
Hi,

I'm trying to create a  character selection screen, where the player presses the right/left buttons and the panels slide in and out  from the right side of the scene.

I'm able to make the panel appear on the scene, but it's not sliding in. It just "POOF" and it appears! I've also tried adjusting the values, but its still the same.

Another problem is that after my panel appears, my game starts to lag until my Flash Player hangs.

I tried following Stencyl tutorials on YouTube but the same problem appears.

Thanks.

« Last Edit: July 22, 2015, 05:55:49 am by chongyunxiang »

Innes

  • *
  • Posts: 1961
I think the problem is that you have it in an [always] block. It's going to create the actor every frame until SlideNumber <> 1, hence the lag and crash.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

chongyunxiang

  • Posts: 216
Oh! Innes, thanks for the solution. It solved the lag problem. But there's another one. I'm trying to have a character selection scene. I created a Game Number attribute called SlideSelector. Depending on what number the attribute is, it'll select different character. So far I only have 2.

I created Left and Right buttons to increase and decrease the SlideNumber attribute by 1, and I set SlideSelector Game Attribute  to SlideNumber. I set 3 different numbers, 0, 1 and 2. So if number is < 0, draw 0 and if number is > 2, draw 2.

Only 1 and 2 have characters. 0 is just a number for me to test if it's working. My buttons are working and I could also draw out character 2 if the HighScore game attribute is above a certain score.

Problem is that I can't draw out the character display panels. I want it to slide from right to left of the screen and it's also not sliding. When I select character 1, no panels came out. When I select 0, panel 1 came out. When I select 2, panel 1 came out.  My Kill Self block also doesn't work.

I set this to be a behaviour called SlideSelection and every time player clicks on the Left and Right buttons, it'll trigger this SlideSelection behaviour.

Where did I go wrong?

Thanks

« Last Edit: July 22, 2015, 08:24:02 am by chongyunxiang »

TheIndieStation

  • *
  • Posts: 2261
I´m glad that you like my tutorials, but I prefer to answer questions in a topic so others learn from it as well =)
First off, you should realize that Drawing an actor is completely different then Creating an actor.  This can confuse people when asking for help!

I also am not sure what you want to achieve, if you want to make a character selection screen, I already did a tutorial on that if I am correct.

chongyunxiang

  • Posts: 216
I must have missed out that tutorial! I was watching your flappy bird, arcade high score, dialogue and RTS videos, etc. If I'm not wrong, you had another account called Artificial Studios. Really worth watching the videos! Can I have the link to the tutorial for character selection?

« Last Edit: July 22, 2015, 08:33:00 pm by chongyunxiang »