EVENT SHEETS
In the Projects Tab, Right Click on Event Sheet 1 to it LVL. Right Click on the Event Sheets Folder & Add Event Sheet (Rename it HERO) Repeat to create an Event Sheet for THUGS. The BOSS Sheet shown is for the Licensed Version of Construct. (Separate Event Sheets Make debugging/organizing easier to handle in the end.)
Click on the LVL Event Sheet so it shows instead of the Layout. The first thing is to create 2 Global Variables that will be NUMBER TYPES. Right Click anywhere on the section and Add Global Variable: Name on Y_TOP_AXIS & Set it for 220 & the other Y_BOTTOM_AXIS & Set it to 10. You can add a Description if you like.
(NOTE: THE Y AXIS IS SET TO 220 LIMITING THE HERO FROM MOVING ANY FARTHER UP ON THE SCREEN. IF YOU MADE YOUR GROUND HIGHER OR NOT AS HIGH, THEN YOU WILL HAVE TO ADJUST THE NUMBERS. AS OF NOW YOU CAN’T TEST IT BECAUSE THE HERO ISN’T SET TO MOVE.)
FROM HERE ON OUT I’M ASSUMING YOU KNOW HOW TO ADD EVENTS, SUB-EVENTS, CONDITIONS, & ACTIONS. IF NOT, I SUGGEST CHECKING OUT ASHLEY’S BEGINNER TUTORIALS OR ONE OF THE FORUM MEMBER’S TUTORIALS TO GET A QUICK UNDERSTANDING.
Start implementing Events 1 & 2 as shown below.
FOR EVENT 3 & 4 YOU WILL SET THE 2 GLOBAL VARIABLES for the HERO.
(WHEN YOU SELECT COMPARE Y YOU WILL NEED TO START TYPING IN VIEWPORTBOTTOM (IT WILL AUTO APPEAR) AND THEN “GAME” AS THAT IS WHAT WE NAMED THE LAYER. IT HAS TO BE TYPED EXACTLY HOW IT WAS NAMED (UPPER/LOWER CASE). TAKE NOTE OF THE < & > SIGNS ALONG WITH THE – SIGN AFTER THE PARENTHESIS.
CONTINUE ON. EVENT 9 (REMEMBER THUGS IS A GLOBAL VARIABLE CREATED A FEW STEPS PRIOR)
SO EVENTS 9 – 14 IS THE SYSTEM THAT ALLOWS THE HERO TO ADVANCE TO THE NEXT SECTION OF THE LEVEL. DEFEAT X AMOUNT OF ENEMIES UNTIL THERE IS 6 & BARRIER 1’S SOLID COLLISION IS DISABLED. ONCE THE HERO’S 8_DIRECTIONAL IS +24 PIXELS PASSED THE BARRIER IT RETURNS TO ENABLED. ADJUST THE 24 OR THE WAIT TIME ACCORDING TO YOUR SPRITES SIZE.
That is all that is required for the LVL Event Sheet for now. We will need to attach the HERO & THUGS Event Sheet to the LVL Event Sheet eventually as the Game will run off based on what is on the LVL Event Sheet.
Actually, Right Click on a blank spot in the LVL Event Sheet & Include an Event Sheet. Select HERO. Repeat & Select THUGS. It will now look as shown below.
If the HERO Event Sheet Tab isn’t present as shown in the previous image, then just Double Click on it in the Projects Tab. First things first, Create 2 Global Variables as shown below & then begin adding the Events.
(Remember the STATUS was the Text Instance Variable given to the HERO. Take Note of the NOT EQUAL Sign being used. Event 12 shows the HERO_SHADOW’s size decrease when HERO is Jumping. This is to give it a better appearance when Jumping.) - (DAWS is the Standard Keys for 8 Directional Movement. Feel free to substitute keys to own desire.)
Event 14 Returns the HERO_SHADOW to its original size. Take note of the several conditions in Event 16.
At this point…go ahead and Run the Layout to see if the standard movement works along with Jumping. (If the Shadow appears in front of HERO, then in Layout Right Click on HERO > Select Z Order > Send to the top of layer.)
ATTACKS WITHIN A BASIC COMBO
There are several ways people have created a Combo System in Construct. I went ahead and wanted to create one from scratch. The following is what I came up with. It will cycle through all the attacks when the buttons are pressed at a standard rate…give or take a millisecond too fast or slow. If it doesn’t work for you, check your number of frames in your various Attack Animations & the Speed they are set at. Adjustments may be needed.
Let us begin. Feel free to choose any K for the Attack Key.
So basically you press the “J” Key – Turns the Status to Attack – Animation ATTK plays – 1 is added to the Global Variable HIT. If you were to press “J” a Second time ATTK_2 would play and so on. We need to make it if the Player doesn’t hit “J” within a certain time frame then it will resort back to another STATUS and start over. Continue to step 39 to see how this plays out.
Once the ATTK is finished playing it automatically returns to IDLE and if ATTK_2 hasn’t been triggered then the HIT Counter returns to 0. This repeats through the sequence of the Combo Attack. Pretty Cool. I will admit there are better Combo Events created, but I wanted to try something different.
So now that the Combo is working decently, we need to spawn those wonderful Hitboxes. Go ahead and enter in Steps 28 – 32. (Now if you created just one HitBox to use then you would adjust Event 31 & 32 of course.)
(If you don’t destroy the Hit Boxes (Attack Boxes) immediately it could trigger multiple damage all at once.)
Now the remaining Events I put into 2 Groups. I could have done this for the Movement Input and the Attack, but I didn’t. You don’t need to, but it is a great way to Organize & debug if need be. However, if you are using a Free Version you are limited to 100 Events & each group counts for 1 Event. Use wisely.
Right Click on the Event Sheet & Select Add Group. First one Shown here is HERO_HURT. Start adding Events.
Event 37 triggers the HERO to hit the Ground when HEALTH Reaches 0.
There is a lot there. Take a few moments to read what the Conditions are & the Actions that reflect them.
Our next Group Created is HERO_HEALTH. This just corresponds with each FRAME of the HEART we created earlier. As the HERO is hit & loses Health, the Frame will change to match it.
The final group is HERO_LIVES. There is much more that can be done to spruce this up such as an Animation or an Image, but this tutorial is keeping it simple.
So basically that is it for the HERO. You may have to tweak some things if you have different animation/frames/sizes…etc.
THUG
Open up the THUG Event Sheet. Add the Global Variable: THUGS with the Initial Value of 9.
Event 3 has the RED X. Right Click on that spot & an Option to INVERT will appear. Click on it. Means Doesn’t Have…(Ignore the 2nd Action of Event 2.)
Events 6-13 is Comparing the X & Y Value of the THUG compared to the HERO in order to direct the THUG towards the HERO.
Events 14 – 17 basically tell the THUG to stop at a certain point and either Attack or Wait. You can always change the Overlapping to Overlapping at an Offset to be more precise once you plug in some numbers.
Events 18 – 27 are so when the THUG collides with a HERO’s Attack Box it will play the “HIT” animation and also subtract 1 from Health. If you want Health less or more, then click on a THUG within the Layout and over in the Properties tab change that specific Thug’s Instance Variable Health to desired number.
Events 28 – 33 go over what happens when the THUG reaches 0 Health and either has some or none Recovers left. The disable and enable of the 8Direction is to prevent the Hero from continuously causing damage even if the THUG is on the Ground waiting to recover.
Go ahead and Select the Following Objects & in the Projects Tab set Initial Visibility to Invisible: All the Barriers, Camera, 8_DIRECTIONAL, PF_MOVEMENT, & all the ATTACK/HITBOXES…unless you truly want them invisible.)
Want to end this with a little thank you to Danyous who showed me the platform/8Directional movement in a 2.5 world and the Viewport limitations with his Beat Em Up Template available in the Asset Store.