locked
Problem With Scene Changing using Properties

    Question

  • I'm not a coder, and I am having two simple problems.

    1) I created a space shooter kind of game based on the video tutorial. However, I'm not able to create a proper transition to the WIN scene. I'm doing everything just like the tutorial guy did on the video (Going to the Enemy Unit behavior panel, selecting Scene Change, selecting Property Change, select Main Scene Property and then setting

    Raise this event when [MAIN] property [# of Fighter Spaceship] [=] [0]

    But, I don't know why, this does nothing.

    In fact, all kinds of property changes are not working. What could I be doing wrong?

    2) How do I create a delay between stuff? For example, I want the game to end if the player spaceship get hit. However, I want this event to happen about 1.5 seconds after the actual collision. What should I do?

    Thanks in advance.
    Thursday, August 07, 2008 1:23 AM

Answers

  • Adding a sound behavior on scene load like you mentioned will prevent looping. Keep in mind the “Upbeat Rave” music file you have selected is about 60 seconds long.

     

    Resizing the projectile – You have a couple options

    1)      Modify the actor’s xaml

    Select the Actors tab

    Select the Enemy Bullet from the Actors list

    Click the Appearance button

    First modify the size of the canvas holding the bullet by setting new values for the Width and Height inputs you see here.

    Now to modify the size of the ellipse we click “Switch to XAML”

    Then modify the Ellipse element’s Width and Height to a smaller value, (e.g. <Ellipse Width="10" Height="10">).

    2)      Custom Code – in the flying saucer’s Shoot behavior click the Code button. After the first line which spawns an Enemy Bullet actor insert the following two lines to resize it

    projectile.SetValue("Width", 10);

    projectile.SetValue("Height", 10);

     

    More info on the Game Creator API can be found here http://www.popflywiki.com/GameCreatorAPI.ashx

     

    Thursday, August 07, 2008 2:35 PM

All replies

  • Nevermind the first one, solved it by adding the property change on the SCENE instead of trying to add it on the spaceship.

    On the other hand, I have new problems =D

    -> How can I keep BGM from looping on a given Scene? I tried to just add the music as a Sound that plays when the Scene is loaded, but it keeps playing even if I swap Scenes.

    -> How can I resize the sprites I am using as projectiles? As you can see in my game, they are enormous!

    Thanks again.
    Thursday, August 07, 2008 4:03 AM
  • Adding a sound behavior on scene load like you mentioned will prevent looping. Keep in mind the “Upbeat Rave” music file you have selected is about 60 seconds long.

     

    Resizing the projectile – You have a couple options

    1)      Modify the actor’s xaml

    Select the Actors tab

    Select the Enemy Bullet from the Actors list

    Click the Appearance button

    First modify the size of the canvas holding the bullet by setting new values for the Width and Height inputs you see here.

    Now to modify the size of the ellipse we click “Switch to XAML”

    Then modify the Ellipse element’s Width and Height to a smaller value, (e.g. <Ellipse Width="10" Height="10">).

    2)      Custom Code – in the flying saucer’s Shoot behavior click the Code button. After the first line which spawns an Enemy Bullet actor insert the following two lines to resize it

    projectile.SetValue("Width", 10);

    projectile.SetValue("Height", 10);

     

    More info on the Game Creator API can be found here http://www.popflywiki.com/GameCreatorAPI.ashx

     

    Thursday, August 07, 2008 2:35 PM
  • sjalex covered most of your questions.  In respnose to your second about creating a delay, there's not a super easy way to do that in the current UI, but if you switch your behavior to code you can probably achieve that using javascript's setTimeout method (do a web search to figure out how to use setTimeout).  Might be a little technical if you've never done any programming. 

    Tuesday, August 12, 2008 7:17 PM