![]() As with most things, you’ll just have to use your discretion. I’ll accept that sometimes unlocking some actors can save you time, and in quick projects it won’t really matter if you can easily maintain them. Occasionally it’ll mean you’ll need to add a few lines of logic to your game that you could avoid by unlocking some actors, but keeping them locked will make maintaining your game, and making changes to it, much much easier. Keeping actors locked unless it’s absolutely essential to unlock them is simply good practice. Some people may argue I’m wrong here, but I’m not. You might be wondering at this point when you should unlock an actor. This is a little confusing at first, will make more sense soon! GameSalad will give priority to the image you put on an actor, not the one the prototype has. You’ll notice the colour of the apple hasn’t changed, though. Were we to preview our scene again, the Display Text behaviour being displayed by our formerly-unlocked blue apple would be the one from the prototype, not the one we edited to say “Blue”. What if you change your mind, though, and want to make an unlocked instance back into a locked instance, and once again have it be affected by the prototype? All you have to do is click the “Revert to Prototype” button. You’ll notice that even though we change the prototype’s colour, and edit the Display Text behaviour, our blue apple stays blue! Since that instance actor is unlocked, nothing we do to the prototype will affect it. Now, to illustrate the effect that unlocking an actor has, let’s edit our prototype. One thing to note here is that you can change certain aspects of ALL instance actors, locked or unlocked, and only the specific instance you change will be affected. This will give us this tasty looking result: Let’s change the image of our instance actor too, while we’re at it. (Obviously if you add certain logic this isn’t strictly true, but it’s a general rule of thumb.) Nothing we do to any other actor will affect it and nothing we do to it will affect any other actor. You’ll hopefully have noticed that now we’ve unlocked the instance actor, the change we made to it only happened to that one actor! An unlocked actor is all alone. Once we’ve done that, we’re going to change the colour written in the Display Text behaviour. To do this, we double click on the instance actor on our scene, and then click on the big padlock icon. At the moment, they’re all locked, and so everything we’ve done to the prototype will have been done to these too. Now we’re put three instances of the apple on our scene. We edited the prototype in the actors list, and the change was visible on the instance actor we put on the scene! We have our apple, and the display text is telling us the colour we wrote in it: Red. ![]() When we preview our scene, it looks like this: This Display Text behaviour is simply going to tell us the colour of the apple. All we’re going to do is to put a Display Text behaviour in it. Then we’ll see how unlocking an instance actor changes things.įirst, we’re going to edit our prototype. We’re going to make a simple scene, and put apples on it. Let’s take a look at an example of how this works, looking at GameSalad. Change the image, the size, the alpha, add logic, remove logic… everything you do to the prototype happens to the instances too. If I make the prototype green, all the locked instances become green too. As long as it remains locked, though, everything you do the prototype will also happen to all the instances. Whenever you drag a prototype actor onto a scene in your game, it becomes an instance of that prototype. To edit a prototype in GameSalad, just double click on it in the actors list. Here’s the Actors list with our prototype apple actor selected. ![]() The three instances actors are all on the scene.Īll the actors in the Actors list on the left side of your GameSalad window are prototype actors. The prototype is at the top, off the scene. You’ll see one prototype actor and three instance actors. We’ll start by exploring the difference between a prototype and an instance. There are two types of actors that you encounter when using GameSalad.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |