Tutorial

Page 4 of 12

Creating Particles With D'n'D (I)

드래그 앤드 드랍 : DnD : 이렇게 쓰겠습니다.

내장 효과들은 간단한 그래픽에는 쓰기 좋습니다. 하지만 다소 단조롭고 한가지 색만 씁니다. 또한 크기에 대한 세밀한 변경이나 반투명하게 만드는 것은 안됩니다. 다행히 Extras tab의 파티클 DnD를 사용해서 더 나은 것을 쓸 수 있습니다.

The built in effects are all fine and well for simple graphics, but they are a bit bland and can only use one color at a time. They also offer no precise control over the size or the alpha of the particles being created and, since they are included as standard with GameMaker:Studio they are far from original! Thankfully we can do better than them using the Drag'n'Drop actions for particles that can be found on the Extras tab of the object interface.



새 오브젝트 "obj_DnD_Firework"를 추가합니다. 이건 첫번째 커스텀 불꽃 효과로 회전 불꽃 효과를 만들어 봅니다. 방금 만든 파티클이 초라해 보일겁니다.

So, create a new object and call it "obj_DnD_Firework". This will be our new custom firework effect, and we are going to make a catherine wheel type firework to compliment our previous built in particle rocket effect.

Create Event를 추가하고, 그 이벤트에 코드 블럭을 추가하고 다음 코드를 넣습니다: Add a Create Event and then drag a code block and add the following code:



이 코드는 오브젝트가 움직이는 것을 막습니다. 그리고 앞으로 사용할 컨트롤용 알람의 시간을 설정합니다. 이제 새 파티클을 만들어야 됩니다. 기본적으로 "컨테이너" 역할을 하는데, 언제든 쓸 수 있는 파티클과 에미터(emitter,방사체)를 여기에 넣습니다.(배치합니다.)

This will prevent the object from moving and set the necessary control alarms too. Now we need to add create our particle system, which is basically a "container" that is created by you and into which you can place particles and emitters to be used at any time.

알아야할것: 시스템에 의해 정해진 오브젝트 없이는 내장된 파티클 효과 외에는 어떤 파티클도 만들 수 없습니다. 그것을 먼저 만드세요.

Note that you cannot create any particles other than the built in particle effects without having first defined a system in which to create them!

이게 되려면, Extras Tab에 가서 Create Part System 아이콘을 액션리스트 창으로 DnD 합니다. 그리고 depth 값을 0으로 정합니다. (다른 오브젝트 처럼 파티클도 깊이 값을 갖습니다.) 앞으로 스모크 이펙트를 만들겠습니다. 이 효과는 진자 불꽃처럼 떠올랐다가 사라집니다.

To do this, go to the Extras Tab and drag the Create Particle System icon into the actions list and set it's depth to 0 (particle systems can have depth too, just like objects and tiles). We are now goingto create our first particle which will be a smoke effect which will rise up off of the main effect just like a real firework.

이 새 파티클에 대해서 속성 값을 정합니다. 즉, 어떤 종류의 파티클을 만들 것인지 정하는겁니다. DnD 인터페이스에서는 16 종류의 전혀 다른 파티클을 제공합니다. 이들을 조합해서 커스터마이징이 가능합니다. Create Particle을 액션 윈도우로 드래그 해서 아래 그림처럼 값을 넣습니다.

For any new particle you must start by defining it's properties, and that means deciding which particle we are going to use. The D'n'D interface offers you a choice of up to 16 different particles that can all be customised to suit your needs. Drag the Create Particle icon into the actions window and fill out it's properties as shown below:



"type" 은 "type 0"을 첫번째 파티클이라는 의미로 선택합니다. (알람 같은 건가 봅니다.) 사전 정의된 모양의 리스트에서 cloud (구름) 모양을 선택합니다. 스프라이트는 선택하지 않습니다. (커스텀 스프라이트도 쓸 수 있지만, 여기서는 필요 없습니다.)

For "type" we should choose "type 0" as this is our first particle and we should give it a cloud shape from the predefined shape list with no sprite (we could use a custom sprite, but for this it's not needed).

사이즈(Size)는 값의 범위입니다. GameMaker:Studio에서 파티클을 만드는 기본 방법입니다. 파티클은 시스템화된 일반적인 룰로 만듭니다. 하지만 각 파티클은 값의 범위가 어떻게 설정 되었는가에 따라 약간씩 다릅니다. 예를 들면, 어떤 파티클은 크기의 범위가 5%(기본 확대 설정값이 0.05)부터 20%까지 됩니다. 모든 파티클은 시작크기(min size)부터 시작되는 크기 범위내에서 만들어집니다. 크기 변화가 없는 고정 크기의 파티클을 만드려면 min size 와 max size 를 갖게 설정합니다.

Size is given as a range of values, and this is a standard mechanism when creating particles in GameMaker:Studio. You see, particles are created by the system based on a general set of rules, but each particle can be slightly different depending on how the range for different properties is set. For example, this particle has a size range from 5% of it's base scale (0.05) up to 20% of it's base scale, so all particles will be created within that range of sizes to start with. Should you need a specific size then you should set both the min and max values to be the same.

"incr" 옵션이(size increment) 0.02로 설정 되어 있는 부분을 주목합니다. 이 값은 각 스텝마다 크기가 변경되는 량을 컨트롤합니다. 양수값으로 설정하면 퍼센티지만큼 매 스텝마다 커집니다. 이 경우에는 매 스텝마다 2%씩 커집니다. 0으로 설정해서 크기 변화가 없게끔 할 수 있고 마이너스값을 설정해서 매 스텝마다 작아지게 할 수 있습니다.

You will notice too that the "incr" option is set to 0.02. This value controls the size increment each step, and setting it to a positive value will add that percentage scale to the particle each step, in this case it's a 2% increase every step. We can set this to 0 for no size change, or even to a negative number to get a particle that reduces in size every step.

기본 설정이 끝났으므로, 파티클의 색상을 설정할 시간입니다. Particle Color를 액션 리스트에 추가하고 아래 그림처럼 값을 채웁니다: With the basic properties set, it's time now to set the color for the particle, so drag a Particle Color icon onto the action list and fill it out as shown:



위에서 "type 0"을 우리가 현재 작업 중인 파티클로 선택했습니다. 그러므로 'type id'를 "type 0"으로 설정합니다. 'Color Mix'는 'changing'으로 선택합니다. 이 방법으로 파티클이 살아 있는 동안 첫번째 색('color1')과 두번재 색('color2')이 자연스럽게 색상이 섞이도록 합니다. 각 파티클 각각이 개별 색상을 쓰게 하는 것보다 낫습니다. 밝은 회색과 어두운 회색을 써서 스모크(연기) 파티클이 되도록 합시다. 그리고 반투명 강도에는 시작은(start alpha) 1 로(불투명), 끝은(end alpha) 0으로(완전 투명) 설정해서 개별 파티클이 자연스럽게 사라져서 안보이게끔 합니다.

As before choose "type 0" as the particle we are working with, then set the color mix to "changing". In this way we will have a nice blend of color over each particle lifetime from the first color to the second rather than a general mix of colors being chosen for each particle. The colors themselves should be a light gray and a dark gray as this is a smoke particle after all, and you should set the start alpha to 1 and the end alpha to 0, so that the individual particles will fade out over time.

파티클이 적당한 시간만 보여지도록 지속 시간을 갖도록 설정 해야 합니다. 이 값은 값의 범위로 설정이 되는데 이말은 각 파티클은 각가 다른 지속 시간을 갖는다는 겁니다. Particle Life를 액션 리스트에 추가하고 값을 설정:

Talking of time, we must also give our particles a lifetime in which to exist, and, as before with size, this can be defined as a range meaning that each infividual particle will have a different lifetime than all the others, with none being above or below the given range. To set this drag the Particle Life icon into the action list and use the following settings:



지속시간은 스텝으로 계산됩니다. 위의 파티클 설정에 의하면 파티클은 최소 5 에서 30 스텝의 지속 시간을 갖습니다.

Lifetime for a particle is calculated in steps, so the above particle will "live" a minimum of 5 steps and a maximum of 30 steps.

마지막은, 스모크 효과가 끝까지 날아 오른 뒤부터의 파티클에 움직임을 주는 겁니다. 이를 위해서 Particle Gravity 를 추가하고 아래 처럼 설정합니다 :

The final thing we should do to this particle is give it some movement, since smoke does rise after all! We can do this by setting the Particle Gravity as shown here:



인스턴스처럼 파티클도 자신의 중력효과와 영향받는 방향을 갖습니다.

Just like instances, particles can have their own gravity force and direction, which will only act on the type of particle specified.

스모크는 끝났고, 저장하고나서 다음 섹션에서 불꽃 효과를 만듧니다.

Now we have done the smoke, save the game and then pass onto the next section where we will define the firework effect itself.



Click on the Next button to go to the next page of the tutorial.