Clickteam Fusion 2.5 [Fastloops ForEach Loops] - Guide

Similar documents
For more information on how you can download and purchase Clickteam Fusion 2.5, check out the website

INTRODUCTION Welcome to this guide on how to use the Extension Manager built into Clickteam Fusion 2.5.

COMPUTING CURRICULUM TOOLKIT

04. Two Player Pong. 04.Two Player Pong

Meteor Game for Multimedia Fusion 1.5

Annex IV - Stencyl Tutorial

Scratch for Beginners Workbook

Environmental Stochasticity: Roc Flu Macro

The Games Factory 2 Step-by-step Tutorial

BEST PRACTICES COURSE WEEK 21 Creating and Customizing Library Parts PART 7 - Custom Doors and Windows

Star Defender. Section 1

Overview. The Game Idea

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

Creating Photo Borders With Photoshop Brushes

Microsoft Excel Lab Three (Completed 03/02/18) Transcript by Rev.com. Page 1 of 5

G54GAM Lab Session 1

Clipping Masks And Type Placing An Image In Text With Photoshop

GEO/EVS 425/525 Unit 2 Composing a Map in Final Form

Table of Contents. Creating Your First Project 4. Enhancing Your Slides 8. Adding Interactivity 12. Recording a Software Simulation 19

The Joy of SVGs CUT ABOVE. pre training series 3. svg design Course. Jennifer Maker. CUT ABOVE SVG Design Course by Jennifer Maker

Hello and welcome to the CPA Australia podcast. Your weekly source of business, leadership, and public practice accounting information.

Getting Started. with Easy Blue Print

BEST PRACTICES COURSE WEEK 14 PART 2 Advanced Mouse Constraints and the Control Box

Getting Started Guide

Add Rays Of Sunlight To A Photo With Photoshop

SAVING, LOADING AND REUSING LAYER STYLES

Digital Imaging and Photoshop Fun / Marianne Wallace

The Joy of SVGs CUT ABOVE. pre training series 2. svg design Course. Jennifer Maker. CUT ABOVE SVG Design Course by Jennifer Maker

Microsoft Excel Lab Two (Completed 03/02/18) Transcript by Rev.com. Page 1 of 6

2D Platform. Table of Contents

User Guide. Version 1.2. Copyright Favor Software. Revised:

User Guide. Version 1.4. Copyright Favor Software. Revised:

Part II Coding the Animation

MODULE 1 IMAGE TRACE AND BASIC MANIPULATION IN ADOBE ILLUSTRATOR. The Art and Business of Surface Pattern Design

Chief Architect X3 Training Series. Layers and Layer Sets

Pong! The oldest commercially available game in history

Tutorial: A scrolling shooter

Perspective Shadow Text Effect In Photoshop

33-2 Satellite Takeoff Tutorial--Flat Roof Satellite Takeoff Tutorial--Flat Roof

QUICKSTART COURSE - MODULE 7 PART 3

Blab Gallery Uploads: How to Reduce and/or Rotate Your Photo Last edited 11/20/2016

SHAPE CLUSTER PHOTO DISPLAY

An Introduction to ScratchJr

CS Problem Solving and Structured Programming Lab 1 - Introduction to Programming in Alice designed by Barb Lerner Due: February 9/10

1 Shooting Gallery Guide 2 SETUP. Unzip the ShootingGalleryFiles.zip file to a convenient location.

ADD A SPARKLE TRAIL TO A PHOTO

Term Definition Introduced in:

Photo Within A Photo - Photoshop

Learn about the RoboMind programming environment

Why Do We Need Selections In Photoshop?

Your First Game: Devilishly Easy

Photo Editing in Mac and ipad and iphone

Blend Photos Like a Hollywood Movie Poster

GETTING STARTED MAKING A NEW DOCUMENT

How To Get High Quality Traffic From Pinterest

Alibre Design Tutorial: Loft, Extrude, & Revolve Cut Loft-Tube-1

PATTERN MAKING FOR THE INFINITY WAND

Go back to the stopped deck. Put your finger on it, holding it still, and press start. The deck should be running underneath the stopped record.

Using Bloxels in the Classroom

Unit 6.5 Text Adventures

Using the Desktop Recorder

1 Best Practices Course Week 12 Part 2 copyright 2012 by Eric Bobrow. BEST PRACTICES COURSE WEEK 12 PART 2 Program Planning Areas and Lists of Spaces

Okay, that s enough talking. Let s get things started. Here s the photo I m going to be using in this tutorial: The original photo.

Instruction Manual. 1) Starting Amnesia

Photoshop Backgrounds: Turn Any Photo Into A Background

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

Programming with Scratch

Blend Textures With Photos

The Slide Master and Sections for Organization: Inserting, Deleting, and Moving Around Slides and Sections

GameSalad Basics. by J. Matthew Griffis

MIRROR IMAGING. Author: San Jewry LET S GET STARTED. Level: Beginner+ Download: None Version: 1.5

Excel 2016 Cell referencing and AutoFill

Graphs and Charts: Creating the Football Field Valuation Graph

After you have completed the tutorial, you will be given an initial knowledge check by ALEKS to determine what topics you already know so ALEKS can

Introduction. So, let's get this moving forward, first things first, some things you will need to get up and running...

The Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? Objectives. Background (Pre-Lab Reading)

Add Transparent Type To An Image With Photoshop

High Speed Motion Trail Effect With Photoshop

Digital Photo Guide. Version 8

GEO/EVS 425/525 Unit 3 Composite Images and The ERDAS Imagine Map Composer

GlassSpection User Guide

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

GameMaker. Adrienne Decker School of Interactive Games and Media. RIT Center for Media, Arts, Games, Interaction & Creativity (MAGIC)

TURN A PHOTO INTO A PATTERN OF COLORED DOTS (CS6)

Assignment 5 due Monday, May 7

2809 CAD TRAINING: Part 1 Sketching and Making 3D Parts. Contents

An Introduction to Lasercut 5.3 Preparing the Artwork

Learning Guide. ASR Automated Systems Research Inc. # Douglas Crescent, Langley, BC. V3A 4B6. Fax:

84 part video tutorial training course. The course is 100% free with no catches or exclusions. You don

Art of Magic and Light Walk-through Part 2

Resizing Images for Competition Entry

Group Coaching Success Free Video Training #1 Transcript - How to Design an Irresistible Group

Legacy FamilySearch Overview

TEXT PERSPECTIVE SHADOW EFFECT

How to Blog to the Vanguard Website

Faculty Lecture Capture Guide

Welcome to JigsawBox!! How to Get Started Quickly...

Making Your World - the world building tutorial

CLICK HERE TO SUBSCRIBE

Transcription:

INTRODUCTION Built into Fusion are two powerful routines. They are called Fastloops and ForEach loops. The two are different yet so similar. This will be an exhaustive guide on how you can learn how to use both Fastloops and ForEach loops. Then we will look at comparisons between the two and certain scenarios which would suit either/or at any given point. Fastloops and ForEach loops will always seem daunting, however, they are probably, combined, two of the most powerful routines Fusion holds internally. Welcome to another guide for Clickteam Fusion 2.5! Some (if not all) of the information in this guide is applicable for Multimedia Fusion 2.0 also. As with all tutorials and guides written in PDF, feel free to display it as a PDF or print to paper. You can study and learn these practices at your own pace, in your own time. Due to Fusion 2.5's flexible nature of allowing users to accomplish the same result in multiple ways, sometimes there are alternative ways to perform certain routines or functions. These guide(s) will explicitly target the most common, easiest and most effective route. These hand-written guides are here to help you target or perform a particular routine in Fusion 2.5 enabling you to harness the full potential of what Clickteam Fusion 2.5 can actually do for you as a developer. Whether it's game design or application development you want to do with Fusion 2.5, these guides will hopefully guide you from top to bottom in whatever you're looking to achieve. This guide has been thoroughly checked before deployment. As always, feedback, comments and suggestions are always welcome on the detail, structure and formatting of these guides. Rather than create individual guides for different learning levels, we hope to be able to reach to all entry level, intermediate and advanced users within the same guide on achieving the same goal. For more information on how you can download and purchase Clickteam Fusion 2.5, check out the website http://www.clickteam.com

CONTENTS 1. An Introduction to Fastloops 2. Using a Fastloop 3. An Introduction to ForEach Loops 4. Using a ForEach Loop 5. Comparisons between Fast and ForEach loops 6. Some Fastloop / ForEach loop advice

1. An Introduction to Fastloops Fastloops were introduced early in Multimedia Fusion 2. They have now become a vital part of Fusion 2.5 and will continue to be one of the most powerful routines you can take advantage of internally. I'm hoping to write this guide with a sense that, you do not know what a fastloop is, or how you can use them, so hopefully I can shed some light on how you can use fastloops to your advantage in Clickteam Fusion 2.5. Imagine you had an active object: Now, you wanted to create a custom movement inside the event editor. In other words, you don't want to use one of the built-in Fusion movements as you want complete control over the movement of this object. Some fastloops would help here. A fastloop basically does an action but repeats it fast, we're talking, very fast. Actually, so fast and so precise the naked eye couldn't really see what happened in the fastloop unless it was repeating. Basically, fastloops were devised, so that the actions could take place before the next frame was drawn. In the next section, we will develop a pixel perfect custom movement. This means, it will move the object literally pixel by pixel. Normally to move an object to the right 10 pixels would take longer than doing it via a fastloop. If you're not sure why, it's probably best to dive in and follow this guide with the hope that you will come out understanding why and more importantly, how.

2. Using a FastLoop Ok, so let's open up Clickteam Fusion 2.5 and insert an active object. Click on Insert > New Object. Select the Active object from the list and click OK. Drop it into the centre of the playarea. Now, we don't need to do anything else with the properties or the frame itself as we're going to code a custom movement in the event editor (using fastloops). So, go ahead and click on the Event Editor icon to jump into the Event Editor. Once you are inside the event editor we need to start making some events. Let's start with a new event, create a new condition go to the Mouse and Keyboard object, right-click and select Keyboard > Repeat while a key is pressed.

2. Using a FastLoop When the prompt dialog appears, hit the LEFT ARROW KEY on your keyboard. This has now inserted a new event. This condition will be met all the time the left arrow key is pressed. Now, on that event line, hover over the first field Special Conditions. Right-click and select Fastloops > Start loop. In the expression dialog that follows, type in left click Okay. Then in the second expression dialog (it will ask for number of loops) type in 5 and click Okay. If you hover over what you just did, it should look like the above image.

2. Using a FastLoop Now, this means that all the while we have the left arrow key held down, it will keep running that fastloop ( left ) 5 times at a constant rate. But we haven't told Fusion what to do on each loop. Let's create a second event. Insert a new condition, in the dialog, right-click on the first icon Special Conditions and select On loop. Once you have done this, Fusion will ask you for the name of the loop. Type in left. Once you have done this, click OK. So we now have our event in that will execute when the left fastloop is running, so let's give it an action when this loop is executed. We want to move our object on the screen, 1 pixel to the left each loop. So, on this event line, hover over to the object, right-click and select Position > Set X Coordinate...

2. Using a FastLoop Like so... To move it one pixel to the left, we need to first get it's current X position, then minus 1 from that. So, in the expression editor, hover over the active object, rightclick on it, select Position > X Coordinate. It should appear in the expression editor. Now type in 1. Like so... Once you have done this, click OK.

2. Using a FastLoop Now, we can test this immediately. Hit F8 on your keyboard to run the application. Press the left arrow key and you will see the object move to the left. Now, let's just look at this a little closer before we move on. Remember we told Fusion, everytime the left arrow key was held in, execute the left fastloop 5 times? This will move it 5 pixels to the left every execution (before it draws the next frame). If you want to move the object faster or slower, just increase or decrease the amount of fastloops respectively. So, to make it slower, just enter 1 fastloop count. To make it move faster, enter 10 in the fastloop count. To do this for all directions, just repeat the above step for Up, Down and Right. See how easy it is to create a 4-directional movement in just 8 events. I hope this was a nice, easy introduction to Fastloops for you. There are literally hundreds of thousands of ways to showcase how fastloops can really speed up development and handle things more easily. The biggest aim for me here, was just to introduce you to Fastloops in a gentle fashion. I hope this quick, movement guide was just enough to start breaking the ice into the world of fastloops. Let's study some ForEach loops in the next section, but don't worry, we will come back to Fastloops and some more examples further down this guide.

3. An Introduction to ForEach Loops ForEach, like the fastloop routine, is another powerful object that is similar in a lot of ways but more useful in others. To try and put it simply, ForEach loops will iterate through a number of objects (of the same) or a 'Group' of objects and apply the necessary actions to the objects that the conditions apply to. With a fastloop if you wanted to iterate through all the instances of one object, you would have to spread manual ID's and compare the ID to the LoopIndex, but with ForEach, this is done automatically. Let's say you have one type of enemy. On the screen, you have 20 copies of this one enemy object walking about but you want to filter down only the enemy objects that have a health of 100 you could easily use ForEach to loop through all the enemies in one fail swoop to filter these down. We will try and cover ForEach extensively and towards the end of this guide, I will try and provide some links to downloadable MFA examples you can take a look at.

4. Using a ForEach Loop In this section, we will setup a basic ForEach loop to slowly introduce you to what they are and how useful they can be. Open up Clickteam Fusion 2.5 and let's begin. Click on the Insert menu then click on New Object. Insert a new Active object... Once it's inserted, position it in the top-left corner of the frame, right-click and select duplicate. In the box select 1 row, 20 columns... Click OK. Your playarea should now look like this: So, we now have 1 object and 20 instances of it spread across the top of the screen. Now you need to double-click on one of them so we can start editing the animation for this object.

4. Using a ForEach Loop Once the image editor is open, copy and paste the frame 3 times, like so... Now, we want to make each animation frame a different colour. So go ahead and select the bucket tool, set the tolerance to 100 and paint each frame a different colour of your choosing. We have done ours like this:

4. Using a ForEach Loop Once you have 4 colours that you want to keep, click on the direction options tab just above those frames. Inside there, we need to drop the animation speed down to 0. This is so, the frames never animate. Click Okay. Now, first of all, hit F8 on your keyboard to run the application. You will just see 20 static objects at the top of the screen, not moving, not animating. Close this and let's jump into the Event Editor to make some magic happen. Insert a new condition, right-click on the Storyboard object and select Start of Frame Now, at the Start of the Frame, we will give each of the 20 objects a random frame (colour).

4. Using a ForEach Loop On this first event line, hover over to the Active Object icon, right-click and select Animation > Change > Animation Frame... When the expression dialog prompts you, type in Random(4) Click Ok.

4. Using a ForEach Loop This will ensure at the very start of the frame, each object will display a random frame (colour) from the ones we inserted. Hit F8 and see this happen. When the app is running, you can hit F2 at anytime to restart the app and you will see the colours reshuffle (this is because everytime the app restarts, it selects a random animation frame each time). Now, we need to insert a new event. Click on New Condition and when the dialog prompts, right-click on the Special Conditions icon (first one) and select Always. On this event line, hover over to the Active Object again, right-click and select Count > For each object When the expression prompt displays, type in move. Click Okay.

4. Using a ForEach Loop Now, this means, Always (60 times per second) we want to run a loop over each one of these objects. But now we need to tell Fusion what to do when it loops over an object. For this example, we want to say move all the objects that are displaying animation frame 0 (which is our example is grey) down the playarea. Let's insert a new condition, right-click and select Loops > On each object. The expression dialog will prompt you for the name of the loop, which we called move so type in move and click Okay. The reason why you have to name your ForEach loop is because you can have multiple loops running at the same time so you need to know which loop to address. Now, you need to hover over event 3 (the event we just did) and right-click again and select Add a new condition. When the dialog appears again, right-click on the active object again and select Animation > Compare current frame of active to a value.

4. Using a ForEach Loop When the dialog prompt displays, type in 0 and click Ok. So what this event here is telling us is, when the ForEach loop, loops over one of these objects AND the selected object is displaying the animation frame 0, we want to do something. So, hover over to the Active Object on this event line, right-click and select Position > Set Y Coordinate. When the expression dialog appears, you need to right-click on the Active Object (we need to first get it's current Y position) like so...

4. Using a ForEach Loop Once you have done this, the expression editor should show: Now, add +1 on the end of that, so your final expression should look like this: Click Ok. So, to recap what we have done here. At the start of the frame, we give each of the 20 objects a random animation frame (colours) between 1-4 (indexed as 0-3). We then tell our program to ALWAYs loop over all 20 objects and when it loops over all these objects, when it comes across 1 or more that has the animation frame 0 showing, move it downwards (Y Position). Hit F8 and see this in action. Whatever you first colour was (in our example grey) that should be the only object (colour) that moves.

4. Using a ForEach Loop What you will also notice is, all the objects (no matter the count) that are moving, are all moving at the same time. This is because the ForEach is looping over the objects so quickly. This pretty much concludes our easy, gentle introduction to ForEach loops (builtin). If you are using an earlier version of the software, you can do this with the ForEach Object. Since Fusion 2.5, this is now built-in to the event editor (as shown above). I strongly recommend you continue this guide by placing all those 20 objects in the centre of the playarea (horizontally) and setup a new ForEach loop to move all the objects that are displaying the second colour (animation frame 1) upwards. If you can accomplish this, you have successfully learnt how to use ForEach in a simple manner. (Tip: to move the object upwards, use Y Position 1). (If you want to test creating a loop moving the objects upwards, remember to use another loopname like moveup or move1 as it's a separate loop).

5. Comparison between Fast and ForEach Loops Fastloops were introduced earlier on in the Fusion series as it allowed for faster development for looping over lots of objects almost instantly, however you did have to manually give each object an ID and compare that object to the LoopIndex of the fastloop but with ForEach you don't need to do this, like so... I have uploaded this ^ MFA to the forums you can download it here: http://community.clickteam.com/attachment.php?attachmentid=12964&d=1399024009 N.B If you are wondering why I chose to 'Always' loop ID's and not just create a set of ID's once in the frame, it's so you get used to this method in case any new objects are created 'after' the first ID spread. Here are some links to other Fastloop and ForEach examples based around the community (thanks to everyone who submitted): http://community.clickteam.com/threads/62097-8-direction-fastloop-movement-collision-example (Thanks to Konidias) http://community.clickteam.com/threads/49032-fastloop-grid-movement (Thanks to Nivram) http://community.clickteam.com/threads/39198-bounce-fastloop-movement (Thanks to DavidN) Don't forget to search the forums for many more fastloop and foreach examples.

6. Some Fast / ForEach loop advice As you have followed this guide, hopefully you have been able to distinguish the subtle difference(s) between Fastloops and ForEach loops. Just above this page, there are a few download links to other example files, tutorials and guides on extending the power of Fastloops and ForEach loops. As you increasingly learn more about both types of loops, you will be able to vision better for your games/apps on how to utilise them. Trial and error is a great way forward. Try creating some prototype techniques before implementing them into a game and see how they work. Just a slight word of warning, Fast and ForEach loops do halt the runtime. Normally, Fusion reads events in order TOP TO BOTTOM in the event list. However, if an immediate event is called (Indicated as a green condition) then it will execute that condition immediately instead of looping through all the condition list before it reaches it. If, a Fastloop or ForEach loop is started, it will become the number one priority event in your entire event list, until it stops. This doesn't mean other events will not execute or keep running, they will, but the loops will take priority over all of them. This being said, it can prove a little intensive on Mobile and Web platforms. The runtimes for Mobile and Web provided by Clickteam are to date, the fastest, nearnative runtimes available, however, there is still a limit as to what Clickteam can achieve with the performance of the runtimes. As you progress on learning more about Fastloops and ForEach loops, eventually you will learn how to not just use them sporadically. You will eventually learn how to use them efficiently, which means things like, only running the loops when they are actually needed and finding new ways to scope down further with your loops using new conditions. Fast loops and ForEach loops are most definitely two of the most powerful and most efficient routines you will learn in Fusion. Keep learning them, do not be afraid to prototype (test) with them and lots of trial and error should send you on your way to achieving some amazing things with the loops inside Fusion 2.5 whether it's for a game or an application.