How to ATTACK 🤺 in GameMaker? | State Machines

  Рет қаралды 24,890

GameMakerStation - Matharoo

GameMakerStation - Matharoo

Күн бұрын

Пікірлер: 52
@GameMakerStation
@GameMakerStation 3 жыл бұрын
Hope you liked it! This was my first video made in 60 FPS. :O ## By the way, a small correction: At 3:30 (line 9) it only sets the moving state if there is horizontal input. That condition should check for input on both axes: if (inputX != 0 || inputY != 0) and within that block it should have an additional condition before the image_xscale statement, checking for horizontal input, as only that makes it turn left or right. Somehow I missed this error in the video and thought I'd put this up here if anyone found that odd. Cheers!
@tips6233
@tips6233 Жыл бұрын
I was wondering... very nice
@seanhamel3551
@seanhamel3551 7 ай бұрын
@@tips6233 I am having the issue of the walk sprite not playing when going up and down, what is the "additional condition before the image_xscale statement" that I need to add that Matharoo has mentioned here to fix this? Thanks
@tips6233
@tips6233 7 ай бұрын
@@seanhamel3551 "if (inputX != 0 || inputY != 0)" Just need to add an OR which is two pipe characters, ||. In the video he is only checking inputX not equal to 0, you need to add the "|| inputY != 0" part.
@seanhamel3551
@seanhamel3551 7 ай бұрын
@@tips6233 thank you, though i did add that before and just tried it again, but my character goes up and down in the idle animation. I thought maybe there was more code needed than that but it looks like I'm lost lol
@CopyCopyOriginal
@CopyCopyOriginal 3 жыл бұрын
Love how snappy and succinct your tutorials are! Much appreciated
@guterversuch6337
@guterversuch6337 9 ай бұрын
great tutorial. i needed a lot of background knowledge for a beginner but the step by step explainaitions made it easy to look up what these things mean
@craigcashman2275
@craigcashman2275 3 жыл бұрын
Excellent tutorial. Being a beginner, I surprised myself that I was able to understand it after several playthroughs.
@Abdulrahman_tramsy
@Abdulrahman_tramsy 3 жыл бұрын
I see that the editing of your videos has been so epic continue with this quality bro
@ziero8546
@ziero8546 3 жыл бұрын
How on earth is this guy so underrated?????
@GameMakerStation
@GameMakerStation 3 жыл бұрын
I don't upload regularly 😉
@BritBox777
@BritBox777 3 жыл бұрын
A much more complex version of state machines than I'm used to using, but a great way to teach people about constructors and the power of meta variables. Hmmm. Yes, I like this.
@frankiejrey
@frankiejrey 3 жыл бұрын
I was thinking the same. I use enums.
@martinmaxking
@martinmaxking 3 жыл бұрын
Good tutorial, thanks. I could use some more of those about structs and constructors bcs I have very hard time to get a grasp on them.
@lucaslimagamedeveloper6787
@lucaslimagamedeveloper6787 3 жыл бұрын
Você tem bons tutoriais! Eu gosto da forma como você programa e ensina. Acho que vou criar tutoriais baseados no seu estilo, só que em português. =D
@computernoise2209
@computernoise2209 3 жыл бұрын
Very good video and blog tutorials. This has really helped me understand sequences and structs better.
@gantz7386
@gantz7386 3 жыл бұрын
I can't figure it out myself so I have to ask: Is there a way to end a stage early? For example, I have a jump stage which triggers upon jumping (duh), but the animation is longer than the actuall jump time. So it finishes the rest of the jump animation while on ground, which looks weird of course. I also have a landing animation which i want to play after the jump, so I set it as the OnStageEnd variable of the jump. So, is there a way I can directly end the jumping stage when the player touches the ground? I don't know how to check if the player JUST landed so I can switch the stage. Any help is much appreciated
@vwxyz345
@vwxyz345 3 жыл бұрын
For sidescroller you could just say if place_meeting(x,y+vsp,oWall) then switch to landing state. For top down it depends how you handle height
@tampuruangflash5922
@tampuruangflash5922 2 жыл бұрын
help me sir, i made another state from this tutorial to run fast with 2 key combinations but the animation only run 1 frame, how to fix it sir? 😥
@HardCraftMovies
@HardCraftMovies 3 жыл бұрын
Very nice Video, thank you. One Question tho, maybe someone can help me. i would say that i have a similar movement code like you in the example. How would you calculate the movement if you want the player to be able to move while attacking?.
@VaughnCampbell
@VaughnCampbell 2 жыл бұрын
your videos are awesome man keep it up
@SmashAdams
@SmashAdams 2 жыл бұрын
some cool concepts here.
@daviondrummond1568
@daviondrummond1568 2 жыл бұрын
What if you didn’t use move x and move y for walking instead you set a var walkspd, hsp,Vsp, and calculate the movement like that
@j.bug.16
@j.bug.16 3 жыл бұрын
so my player has 8 directional and different animation/sprites for each. how would i do a walk state like this? i can see in the video you only have one walking sprite and you’re just using the image_xscale. hopefully you can help :)
@GameMakerStation
@GameMakerStation 3 жыл бұрын
I'm guessing you probably have a state system for your characters, so you will need to create a separate Sequence animation for each directional state and store which Sequence needs to play based on the direction.
@ReedNunnemaker
@ReedNunnemaker 9 ай бұрын
not working for me at all. im getting a "not set before reading it" for every state assignment. HELP
@KG_ZZ
@KG_ZZ 9 ай бұрын
my blue hitbox only shows on my player when i attack, not my actual attack which i made the oHitbox ans set the sprite and mask to the hitbox. stuck :( thanks for vid though
@robinorbitamusic7456
@robinorbitamusic7456 3 жыл бұрын
exellent tutorial. Keep it up bro.
@CopyCopyOriginal
@CopyCopyOriginal 3 жыл бұрын
Question about the enemy’s effect where they get knocked back upon hit. I have something similar in my project but yours here looks much smoother, could you talk a bit about that effect?
@FoxyOfJungle
@FoxyOfJungle 3 жыл бұрын
It basically sets the "hsp" and "vsp" to the vector direction between the enemy and the player.
@CopyCopyOriginal
@CopyCopyOriginal 3 жыл бұрын
@@FoxyOfJungle ah! perhaps i will fiddle around with my code to smoothen my effect. thanks for the reply!
@gurpreetsingh793
@gurpreetsingh793 3 жыл бұрын
@@CopyCopyOriginal my code also lerps the xy speed vectors to 0 in step, thats why its smooth. Sorry on personal account right now
@CopyCopyOriginal
@CopyCopyOriginal 3 жыл бұрын
@@gurpreetsingh793 ahhh...okay interesting. and i assume they go into a 'hurt' state, and only leave that state after those values finish lerping, something like that?
@GameMakerStation
@GameMakerStation 3 жыл бұрын
Not in this example project, but that would be fine to implement.
@cvalerinv
@cvalerinv 2 жыл бұрын
I have a bit of a problem, I'm trying to make a platformer like game. so far this has worked flawlessly for all sprite animations except melee. I tried using your hitbox and the state set attack. however this creates a sprite at the location when I pressed the key. so my character keeps walking and leaves behind a copy that's performing the animation.
@grantthurtt3133
@grantthurtt3133 Жыл бұрын
try disabling the view of the layer that your player is in in the hitbox sprite editor
@thundery_1924
@thundery_1924 3 жыл бұрын
thanks for the video will really help
@randomboy2004
@randomboy2004 3 жыл бұрын
hey can you make a random world genaration? . like making a random island for a crafting game
@totidokkan
@totidokkan 3 жыл бұрын
i really hoped that he included the code in the enemy object so i make my mele attack work...
@thebigboys324
@thebigboys324 9 ай бұрын
for some reason it dident work for me but i loved the tutorial=)
@abdoun8214
@abdoun8214 3 жыл бұрын
Could you make top down slopes collision tutorial?
@Hugo_dsa
@Hugo_dsa 3 ай бұрын
5:18
@maniksinghgamer5099
@maniksinghgamer5099 3 жыл бұрын
Nice video
@mehmetyigitkeskin5049
@mehmetyigitkeskin5049 3 жыл бұрын
Awesome!
@headspin4120
@headspin4120 3 жыл бұрын
cool!!!
@maniksinghgamer5099
@maniksinghgamer5099 3 жыл бұрын
OMG so hard work codeing
@guterversuch6337
@guterversuch6337 9 ай бұрын
steeeet
@Pavel19774
@Pavel19774 11 ай бұрын
Bro my hands
@eveeve-j3y
@eveeve-j3y 8 ай бұрын
most of this does not work
@009crv
@009crv 2 жыл бұрын
greu
Moving Platforms in GameMaker | Jump-Through / One-Way Platforms
8:56
GameMakerStation - Matharoo
Рет қаралды 18 М.
Why EVERY Gamemaker dev should use Structs
18:33
RiptideDev
Рет қаралды 8 М.
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
She wanted to set me up #shorts by Tsuriki Show
0:56
Tsuriki Show
Рет қаралды 8 МЛН
GameMaker Inventory with Structs | GMS 2.3+ New Features
7:48
GameMakerStation - Matharoo
Рет қаралды 24 М.
5 Useful Scripts for GameMaker Studio 2 (and 1!)
9:34
Sara Spalding
Рет қаралды 101 М.
Making a Game About Weak Points
21:27
Emis
Рет қаралды 1 МЛН
Much bigger simulation, AIs learn Phalanx
29:13
Pezzza's Work
Рет қаралды 2,9 МЛН
РОБОТ-ПЫЛЕСОС за 1$ vs 1000$ !
23:02
GoldenBurst
Рет қаралды 188 М.
Optimisation Tips | GameMaker Studio 2
19:10
FriendlyCosmonaut
Рет қаралды 51 М.
Finite State Machine for beginners | GameMaker Studio 2
8:29
How do these 1997 Graphics Look This Good?!
13:26
Marco Bucci
Рет қаралды 945 М.
Can I 100% Superliminal and Get a Refund?
23:36
Gronf
Рет қаралды 360 М.
The Trick I Used to Make Combat Fun! | Devlog
8:12
Game Endeavor
Рет қаралды 1,7 МЛН