The Daily Click ::. Forums ::. Klik Coding Help ::. Oh ye Click Gods, here my prayer I figured out GOOD jumping finally, but one thing is left!
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
29th July, 2007 at 21:47:43 -

Hi! If you're one of the 4 or 5 people who I asked to help me with my crap jumping code then you already know, but I've been desperately trying to convert Rovert's Triangle trajectory into a nice curve w/ velocity and etc for weeks now with no luck.

That is, until tonight! YES! Somehow I figured out a way to weed through my big messy code with a million flags and crap and put in one of the examples someone mentioned on the forums that said to use a "Y Speed", and set it to -7, and have gravity constantly going and lo and behold it worked!

..Almost!

The problem is, the constant gravity. I tried using "always" to add 1 to the Y Speed value, and Rovert hardly gets off the ground. By increasing the negative Y speed value for a jump it only makes him jump higher, but at a really fast and crappy rate. To sum it up in order for me to delay the gravity I used *gasp* A TIMER!!

So, to make a cool arcing jump I ended up liking setting the Y Speed value to -4 upon jump, with a constant gravity of +1 to Y Value every 11 milliseconds. I don't have an issue with Rovert getting stuck at all (Fortunately the code that was already there works great so this doesn't happen). The problem is, because it's done with a timer Rovert's jumps are not always the same height because the player is not always pressing jump at the same point in the 11 millisecond loop. Call me crazy but this won't do.

It's the ONLY thing holding me back now from making a decent, playable game. I call upon the Click Gods here..

HELP MY ASS!!

and

THANKS!!

EDIT: Oy my God, I mispelled "hear" lol! I'm a little excited, you see. I hooked up the online computer just to ask the question!

Image Edited by the Author.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Phrizzy



Registered
  29/07/2007
Points
  9
29th July, 2007 at 22:33:55 -

Hi, sorry I didn't answer your mail, I've been discouraged from clicking due to being banned for no reason.

The easiest way you can make it work with what you have there would be to have the 'always add one to Y velocity counter' event, and then you need to multiply and divide your speed by things to work out the movementy something something.

Uhh... What I mean is, instead of setting the variable to -7 when you want to jump, set it to -21. Then when you want to tell it how much to move Rovert based on this value, tell it to do this:

Set Y Position to Y("Rovert") + (YSpeed("Rovert")/3)

Or however you want to move him, but you must divide the number of pixels to move based on this value by 3.

So this would make the Y Velocity variable represent the number of pixels to move your character vertically per frame, but three times larger for storage.

btw tdc sux

Image Edited by the Author.

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
29th July, 2007 at 23:02:46 -

Great, I wouldn't have thought of that, thanks Phizzy!

I tried to use your example because it looked the best. This isn't really too much like it, but it's still a hell of a lot better than what I had. I'll go offline and hook up the good computer and try it now

Don't worry about the mail, most people weren't able to open the .cca (I think it was a flawed copy or something).

I'll make sure to add you to the thanks list as well!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
30th July, 2007 at 01:29:14 -

I'm not a big fan of division when it comes to this stuff-- dont ask me why, I dont trust MMF when it comes to decimals.

I offer two ideas for the timing issue!
1.) The way I did it for my current project is this: The player has two alterable values, one called "gravSet" and one called "gravCount." I set gravSet to 4, and in my events I say "player is off the ground, add 1 to gravCount" and then, when gravCount >= gravSet, I add 1 to the ySpeed, and then reset gravCount to 0. So basically, by adjusting gravSet, the force of gravity can be changed. Also, reset the gravCount back to 0 when the player is on the ground, or actually reset it to any number. I actually put it back to 1 less than the gravSet, so that the player will immidately fall when he walks off a ledge.

2.) Instead of using 11 milliseconds, you could use a counter called "totalFrames" and always add 1 to it. You could use that as your timer, and it would always be the same. Instead of saying "Every 11 milliseconds" you could use the compare to general values and say "totalFrames mod 11 = 0" and use that to add 1 to the yspeed.

Err, actually I guess number 2 actually wouldn't solve the issue of the timing! Guh, I was thinking of it weird. I shouldn't post when I'm really tired anymore.

Or just... use division =D

Image Edited by the Author.

Image Edited by the Author.

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
30th July, 2007 at 05:53:41 -

I'm with Phizzy's solution. Also makes tweaking/changing the gravity settings pretty easy.

 
Old member (~2004-2007).

Phrizzy



Registered
  29/07/2007
Points
  9
30th July, 2007 at 06:36:10 -

I'm not a big fan of division when it comes to this stuff-- dont ask me why, I dont trust MMF when it comes to decimals.

Since you're not adding or multiplying by any floats in the expression, the variable remains an integer. You don't need to worry about MMF turning things into floats and fucking up.

totalFrames mod 11 = 0

That's 220 milliseconds, not 11.

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
30th July, 2007 at 08:38:44 -

I changed 92 (!!) frames' worth of "Rovert Movement" groups last night, my God what a pain that is!

So, it worked great! Much better, although for anybody (mostly me) who's used to how fast he got off the ground / to the ground it's way different. I would guess that his jumps are a cross between Kuros from Wizards & Warriors and Mario. He's a lot more floaty than before, but it's not a deal breaker. IMO, it still looks and works better than what I had before. The main thing was that I had to make it so that he could still reach the same height for both types of jumps because the whole game is designed around that. He could jump 5 bricks high regularly, and 10 bricks high with the high jump before. Now, he can jump 6 bricks high normally (best I could get, but no biggie) and still 10 bricks high with the super jump.

The main thing I have to do now is basically edit the crap out of the puzzles where you needed the speed boost from the Blade of Del Duio before, because now you can reach them with a regular jump since he's floaty and all (not a bad thing, I just need to rework some stuff is all.) The biggest pain of all though is having a lot of events that deactivated / activated the movement before. Since I had to delete / paste the new group in, these all got deleted so I have to put them all back in there. It'll take a while to finish, and it'll be tedious no question, but the end result is all that'll matter.

I never had much luck with global events, otherwise I would have just had to paste it once.

Oh, and I also put very slight gravity to the holy crap projectile where every 20 milliseconds it adds +2 to the Y value. You can still hit things that are almost across the screen AND line it up to kill ground enemies, which is what I want.

Thanks again, everybody. It's not the best jumping in the world but at least it'll be playable now

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

nim



Registered
  17/05/2002
Points
  7234
30th July, 2007 at 12:27:19 -

The jumping action is the single most important aspect of any platform game. If you need to, manually changing the code in 92 individual frames is still worth doing.

 
//

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
31st July, 2007 at 12:57:36 -

Yeah, you're right Nim, I'm very glad that I changed it as now more people will actually want to play past the first 5 screens or so to try and win it.

But there are a lot of bugs that popped up ever since I changed it that I need to fix. I've been discovering / fixing them constantly since the big changeover. MMF kind of screwed up on me a bit which set me back when one of the groups I pasted into each frame ended up acivating / deactivating the WRONG EVENTS! I'm not sure what happened, but it's fixed now!

I had to fix all of the bubble nozzle / generators because there was code before that deactivated the old movement while Rovert was inside a bubble, and although I thought I had fixed it by simply changing to the right event, the new gravity made the off-screen repositioned Rovert fall into things he wasn't supposed to- pretty funny stuff.

Now believe it or not there seems to be some sort of memory problem when I try casting some spells in some rooms- Some times it works, and others he just gets stuck in casting mode and the game freezes up. It probably has to do somehow with the new movements (I hope) because I don't think I've ever run into a resources problem with MMF1.5 yet.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click