Users browsing this thread: 3 Guest(s)
PBG Engine
#31
Geez. I didn't even think about how that doesn't make sense. *facepalm* I feel so stupid. I know it was rhetorical, but I messed it up because of this. When you let go of the left/right key, your speed variable drops. But not instantly. So if you hit the opposite key right away you drop speed quicker than when holding the other key. Lemme just give an example through time.

Letting go ONLY:

Frame. Speed

1. 7.5
2. 6.0
3. 4.5
4. 3.0
5. 1.5
6. 0.0

Holding opposite key:

1. 7.5
2. 7.0


Well... You get it.

EDIT: Well.. I fixed the momentum... But that f$&king midair slash stop IS REALLY PISSING ME OFF!!! I try fixing it by making it only check if he's attack when he's in the ground. HE CANT ATTACK IN THE AIR. ITS PISSING ME OFF. AHHHH!!!!!! ...okay... Calm down. Imma try and fix it.
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#32
Code for keyboard left/right event
Code:
if!(sprite_index == sprAttack && !place_free(x, y + 1)){
  //Movement code here
};

Replace sprAttack with whatever your attack sprite is called. This code checks if the player is on the ground while slashing, and if both of these are true, the code to accelerate does not run.
Reply
Thanked by:
#33
Wait does checking the sprite only mean checking if hes attacking or not? If so I have a variable called attack thay is set to 1 whem hes attacking. Could I replace it with
attack=1?
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#34
Yeah, that should work.
Reply
Thanked by: Joxon
#35
Okay I tried it, but know he won't move in air.
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#36
You put the ! where I did, right?
Reply
Thanked by:
#37
Yeah, but I replaced the sprite_index with attack=0 and removed the ! Was that a bad idea? Also what is the ; for in the code?

EDIT: okay, so I switched it with !(attack=1 and it sorta works... I can only move in air if he gets enough of a running start. But it might not be your code, it's probably something in another script.
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#38
The ; tells Game Maker the statement has ended. Also, I really don't know what to tell you at this point; I'm kind of going in blind trying to help you with this. If I'm gonna help, I'd need to see the code itself so I know what I'm doing.
Reply
Thanked by:
#39
Here are the codes that are involved in the current problem.

https://www.dropbox.com/s/mh3vvw4vp33zdt...S.txt?dl=0
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#40
..All those Ifs....so scary....

There has to be alternate ways to handle state than this.  I'll try to look into GM some time to see if there are better solutions.  You handle animation, collisions, attacks, physics, etc all in the same block of code...  That's insane man.
Animations - MFGG TKO (scrapped) - tFR
[Image: QUmE6.gif]
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
Reply
Thanked by:
#41
Just so you now those all are from different events. I just put them into one text doc.
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#42
You should really use blocks for statements that use the same conditions. Like this:

Do:
Code:
if(condition1){
  statement;
  statement;
  statement;
};
if(condition2){
  statement;
  statement;
  statement;
};

Don't:
Code:
if(condition1)
statement;
if(condition1)
statement;
if(condition1)
statement;
if(condition2)
statement;

I'll look through your code more thoroughly later, but right now, just work on cleaning it up.
Reply
Thanked by: Joxon
#43
Ughhhhhhh... UGHHHHH!!!! I guess putting Attack=0 WAS a bad idea... Well moving works now, but there's something where if he attacks in air he moves faster. But it souldnt be that hard to fix.
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#44
https://www.dropbox.com/s/wr0uonc71ykwrk...20BETA.exe#

Okay, a few updates, the momentum should be fixed... Well I think that really is it. I tried a full screen resolution, but I think I'm gonna switch it back. I was tinkering with the air slash so it's not completely fixed yet, but Im working on it. I couldnt get the jump hold to work right.
i set it so that for a set amount of time he'll be able to rise a little higher, unless you let go of the jump button or hit a block from above. Now everything worked accept for how it felt. Instead of jumping it felt more like using rocket boots in Terraria. So that's a problem
[Image: rHiHaRN.jpg]
Reply
Thanked by:
#45
I think the acceleration is being caused by the game not checking if the player's speed is at maximum before letting them speed up. I've also noticed a few issues:

Clouds are solid from below. You'd think something like a cloud could be jumped through, since clouds normally aren't solid.
When hitting an enemy, they make the same hurt sound you do, so I thought I was getting hurt at the same time as them. If they're gonna make a hurt sound, they should make their own.
The screen is so tiny, even smaller than mine, yet you don't allow the window to be resized. At least allow switching between fullscreen and windowed. Is there any reason why you're doing less than 240p?
You can walk right off the edge of the map and disappear. This shouldn't be possible unless you're doing SSB KO's or something. Also, the room doesn't reset when you fall off, so falling means having to completely restart.
I don't see the added control to jump height you mentioned. Both holding and tapping brought me up to the same height.
Octorok bullets are too tiny to see clearly, especially when you can't change the window side. Though, they hardly ever fire anyway, and the octorok basically just sits there, like, "hit me! I'm meat!"
The transparent clouds floating in front of everything are distracting, especially where there's solid clouds that look exactly the same.
Reply
Thanked by:


Forum Jump: