Well, it’s time to do some real testing now !!
I tried few things in one little level… I’d better warn you it’s not awesome, but I did it without adding a single line of code ! I just used state machines to check inputs, trigger actions, enable gravity and so on. And I think this is the cool part cause anybody could do that (even without programming skills I mean).
I did the whole thing quickly so I didn’t pay attention to gameplay (running speed is too fast, dash move is a bit weird, gravity is too high etc.), but I could tune it easily.
I found some nice sprites of Zero (you know, the character from Megaman / Rockman !). This version is from “SNK Vs Capcom”. I used it as a placeholder for the player.
In this video, you will see (there are some things I mentioned in previous posts but never showed by the way) :
– “Ghosts” for movements
– Layers : several layers with different speed.. It’s maybe too fast, but you’ll get the idea.
– Collisions (red polygons show the collison maps. By the way I noticed I used rectangles only, but it could be other convex or even concave polygons)
– Events (once the player reached the zone, it triggers dialog box and shader distortion)
– Shader (the distortion I added last week) -> I coded this shader before even starting my engine actually (I’ve been waiting a whole year !!)
I still have some things to do to improve collisions and I think I should add a tool to create collision maps directly in the level editor… Right now when you create a new static object you can draw a colmap for it (then it’s used for every instances of the same object). I should be able to draw something for the whole ground too. It’ll be useful and will spare some collision calculation.
I didn’t use sound nor Fx (I could… while running, jumping, and so on). It’s lame. Next time, for sure.
Here comes the Level Event Manager I did for this level :
1. I’m playing FX in loop on the event zone (the one at the end of the level ! Check the pic. on the left) while the player is not detected;
2. Once the player is there, I launch the distortion shader (I added it to a shaders bank I created and its rank is 0);
3. I change the state of the player (I created a state in which there’s no action nor move allowed);
4. I start the dialog !
I hope it looks easy, cause since I’m used to it, I love it !
Now, let’s check one of the player’s state machine ! I took the “State_Run” cause it’s not the easiest nor the most difficult to understand ! The “State_Jump” is the worst actually.
The yellow branch is the “Entering condition” for the states who allowed the “State_Run” as a next possible state (actually, only the “State_Idle” does), don’t forget !
1. In green you see the next possible states (double click to enable/disable !). It means, while running you’ve got gravity (“Gravity” is not a real state, I just use the entering condition branch to trigger an impulse every frame), you can kneel, jump, or dash.
2. Playing the Run action from the player’s Action Bank.
Looks like everything is working well. I encountered some bugs here and there but nothing hard to fix so far. I’ll try to use the same level and add things one by one till I’m able to try every single part of my editor. I still have : lights, fx, sound… And things I didn’t even mentioned like rain effect, projectiles and material system (to trigger a specific fx/sound on different objects collision). There’s still some work before starting a real game, but it’s getting closer and closer. Yeah !