top of page

Double Jump with Key Debouncing

Writer: Bruce
Bruce
May 29, 2022
1 min read

Here's a quick way to enable a Double Jump feature in your MPAGD platform games. It also includes a key debounce so that the Double Jump isn't initiated automatically by keeping your finger on the fire/jump button/key.


I've used a variable, J, that will store our current jump status, you could use a sprite variable like SETTINGA if you prefer. For the Double Jump feature there are five possible jump status:


0 No Jump active

1 1st jump has been initiated

2 A second jump is possible

3 A Second jump has been initiated

4 The player has landed after doing a jump.


By using an IF ELSE ENDIF on our fire key, we can ensure the right status is set which will the allow (or) not a second jump. This code will also ensure the fire key has been released before any type of jump (single or double) can take place.



Here it is in action, I've displayed the J Value at the top of the screen to help you see what was going on!



2 Comments


lydiaharve.y50.4.4.4
Aug 26

Bài của bạn trình bày ngắn gọn mà dễ hiểu, mình đọc liền một lượt là nắm được ý, cảm ơn bạn đã chia sẻ. Mình cũng có thói quen xem thống kê XSMB hằng ngày, nhưng hồi trước phải mở nhiều nơi khác nhau nên mất công và dễ bị rối. Về sau mình tự gom lại cho tiện theo dõi, kiểu để mọi thứ ở một chỗ để lúc cần chỉ mở ra xem nhanh, nên mình lưu trên soicau247.com để khỏi phải lục lại từng nguồn. Nhờ vậy mỗi ngày mình chỉ cần vào là thấy số liệu theo ngày, nhìn lướt cũng đỡ tốn thời gian hơn. Nếu bạn cũng hay xem phần đầu đuôi thì…

Like

Tom Potter
Tom Potter
Sep 15, 2023

Hi Minilop. First, thanks for the tutorials which are amazingly helpful in coding my first MPAGD game. I was wondering if you could help answer a question for me? MPAGD won't let me create more than 35 sprites, but I can't find this limit mentioned anywhere in the documentation. Can you confirm that MPAGD will only allow 35 sprites? Or am I missing something? Many thanks! Tom

Like

Want to support my work?....Buy my games!

aboutME

Hello, I'm Bruce and I write games for old 8bit computers using Jonathan Cauldwell's excellent Multi-Platform Arcade Games Designer (MPAGD)

I've written a few successful* games for the Sinclair ZX Spectrum and MSX platforms that have been (largely) well received including Twenty Four Hour Parsley People scoring a 10 out of 10 on Planeta Sinclair.

In my blog I am sharing lots of the code that I wrote for my games, in a way that you can use in your own games.   I've commented it so that you'll learn some of the techniques I use to create interesting new mechanics and help your games stand out from the pack.

MPAGD includes lots of standard scripts, they're great to get you started, but if you're new (or just rusty) when it comes to writing code, hopefully my tutorials will help you get started and  turn your imagination into awesome 8 bit games!

All my code is free to use and do with as you please, but if you find them useful please feel free to buy me a coffee ...or better still - buy or download my games :)

*successful is a very relative term in 8bit computer games

bottom of page