The Daily Click ::. Forums ::. Klik Coding Help ::. Unlockable Powerups
 

Post Reply  Post Oekaki 
 

Posted By Message

slepren



Registered
  10/03/2005
Points
  33
22nd July, 2009 at 01:16:40 -

Hi all,

I've been working on a platform game based off of a fastloop engine, but I can't seem to figure out how to make power ups. The main example I have is making a double jump unlockable after collecting a power up for it. Can somebody please point me in the right direction?

Thanks

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
22nd July, 2009 at 01:26:57 -

Well a solution won't be universal since you're using a custom movement. It depends on how the jumping is setup. If it's something quite so simple as setting a counter to a value to make him jump, then all you have to do is something like:

Character collides with powerup blob
>>Set character alterable Value A (Or whatever) to 1.

{Code to check whether character is already jumping/falling}
+Character Value A = 1
+Character Value B (or whatever) = 0
+Player presses jump key
>>Set counter to appropriate value again
+Set character alterable value B to 1

Player collides with obstacle
>>Set character alterable Value B to 0

That's not very specific but I think (unless I'm utterly wrong) that we'll need more details to help any further. Powerups are simply a matter of programming the capabilities, and then adding conditions that check to see if the appropriate value has been set after the collectable thing was collected.


Edited by OMC

 

  		
  		

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
22nd July, 2009 at 02:17:32 -

You could use an inactive group to activate double jumping in order to keep things a bit more organized and easily accessible.

 
n/a

slepren



Registered
  10/03/2005
Points
  33
22nd July, 2009 at 02:24:08 -

Thanks...you gave me an idea that worked out for me.

 
n/a

slepren



Registered
  10/03/2005
Points
  33
22nd July, 2009 at 03:10:14 -

My idea worked, unfortunately it negated the velocity sensitivity of the jump "pre-double jump"

The engine is based off of DavidN's fastloop tut.

I added a new alt value to "Player" called "double jump", and also made an active object "power up" and gave it the "collectibles" qualifier.

"Double jump" = 0 --- set "Jump count" to 3 (since 0-2 are used)
"Player" overlapping "group.collectibles" --- set "double jump" to 1 + set "jump count" to 0 + destroy "power up"


What can I do to keep the velocity sensitivity until the "power up" is collected?

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
22nd July, 2009 at 05:52:14 -

Kind of hard to understand, I think it would be a lot easier if we saw more code. Any possible chance you cold post a small example file that we could edit for you?

Heres how I usually do simple double jumps
Player is falling
+ Pressing Jump
+ player "Double Jump" Value = 0
- Set player "Double Jump" Value to 1
- Make player Jump (Whatever condition you use whether its a variable/counter/flag etc)
- Set player "Jump Strength" Value to X

Player is on the ground
- Set player "Double Jump" Value to 0

You could place all of the above code in an inactive group then

Player collides with double jump powerup
- Condition (window explaining double jump etc. whatever)
- Activate Double Jump group

Even though this is pretty much common/basic knowledge, I usually don't show people my exact methods of doing things (I'm uptight/OCD about it for some reason) so consider yourself lucky




Edited by GamesterXIII

 
n/a

slepren



Registered
  10/03/2005
Points
  33
22nd July, 2009 at 07:01:32 -

Thank you very much. I will try to implement something like this.

The problem that I am running into is that the "jump count" vars 0(standing on backdrop),1(mid jump, jump again) are used for the actual double jumping. Then I implemented "Double Jump" and set "jump count" to 3 when "Double jump" is = 0 so MMF would bypass the actual double jump movement and see "jump count" as null. But this messes up the velocity sensitivity. So I tried setting the "jump count" and "Double jump" alt vars the opposite way and it negated the "post" power up velocity sensitivity.

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
22nd July, 2009 at 15:40:10 -

I think you're taking a more difficult path to a simple solution.
It still seems like you are leaving out vital information that is needed to help you fix your code.

try changing your code like so

Double Jump = 0
+ Player is not standing on backdrop - add this
- set jump count to 3

Player is standing on backdrop
Set Jump Count to 0

That way your jump count is 0 when standing and 3 when jumping, as long as double jump isn't an active powerup.

can you recreate a small app with just the jumping/double jump system implemented so I can take a look?




 
n/a

slepren



Registered
  10/03/2005
Points
  33
22nd July, 2009 at 19:54:54 -

There was one line of code that inhibited the velocity sensitivity which looked like this:

+JumpCount("Player")=1

and after scouring the code and going crazy I found that and removed it. That completely fixed my problem.

I do very much appreciate everyone's help. I will definately be posting other questions.

Thanks

 
n/a
   

Post Reply



 



Advertisement

Worth A Click