With the wall selected, press Ctrl + C to copy and Ctrl + V to paste. STEP SIX: Now, we need to copy this and put the copy on the right side of the frame. Our player will still be able to hit and collide with it. It will still exist in the scene, but it is just not being rendered. We put the wall outside of the frame so that we don’t see it in our game. You can move the object by clicking and dragging the center circle in the middle of it. Notice how it covers the entire left side of the frame. STEP FIVE: You’ll want to end up with something like in this screenshot. The handles are circled in this screenshot: To resize the object, use the handles on the edges of the object in the scene to resize it. STEP FOUR: What we want to do is resize the object so that it is a tall, thin, object that covers an entire side of the scene. STEP THREE: Drag the Wall into your scene by clicking on its name in the Actors list and dragging it into the scene. STEP TWO: Rename this actor by double-clicking its name in the list of Actors. STEP ONE: Add a new Actor using the Library → Actors section Instructions:įirst thing’s first, open up your GameSalad project that we created last time. Once you know how to create a basic collision detection, you’ll be able to apply the same workflow to the rest of your game. Our player will not be able to move passed any of these boundaries. We will create four walls around our scene that will serve as a boundary. Since this tutorial is still an introductory one, we are going to implement a very simple example of collision detection. Fortunately, GameSalad makes it easy for us. Creating collision detection from scratch is somewhat complicated and requires some serious mathematics. The ball and paddles know when they are colliding with something and execute some behavior as a result. Fortunately, GameSalad makes it easy for us.Ĭollision Detection is what makes these mechanics possible. Collision Detection is what makes these mechanics possible. If the ball hits a paddle or a wall, the ball bounces off of the object and moves in the other direction. When a paddle hits a wall, it stops and you can no longer move in that direction. The paddles can only move up or down until they run into a wall. Likewise, it can collide with any of the walls that surround the playing field. In Pong, the ball can collide with the two paddles on either side of the screen. Even the most primitive of games have collision detection. It’s basically a fundamental mechanic for any video game. What is Collision Detection?Ĭollision detection is a game mechanic in which objects can detect when they are colliding with one another. In this post, I’m going to continue from where we left off and talk about collision detection. As promised, I want to continue with some more tutorial posts to help you get on your way to developing your ideas. I covered the UI and how to create an actor and make that actor move in your scene. In my last blog post, I talked about the absolute basics of GameSalad.
0 Comments
Leave a Reply. |