PikoPong
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux
No Result
View All Result
PikoPong
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux
No Result
View All Result
PikoPong
No Result
View All Result
Home Web Dev

Oh Mummy – 7-Jul 2020

July 7, 2020
in Web Dev
283 9
Oh Mummy – 7-Jul 2020


This most recent round of development has been dedicated to squashing out bugs and investing in performance optimisations.

What’s particularly fun about NextBASIC is that it’s so close to the metal (as it were) – NextBASIC -> interpreter -> machine code – that it has a heavy hand in the code design that I work with.

I’m used to JavaScript which goes through part compile, part interpreted along with a lot of JIT’ting and hot path optimisation. No such pleasantries with NextBASIC.

A simple example is that in modern high level languages, I’d reduce my code reuse and refactor based on the rule that if a value or expression is used more than once, then it belongs in it’s own variable or routine.

Using that approach with NextBASIC comes at a cost, a cost that is immediately visible in the execution. Multiple routine calls slows down the runtime speed. Inlining code will always speed execution up (and this is also true of languages like JS).

There’s also the aspect of finding the absolute perfect fit of code for the problem – which again in JavaScript (or other languages) the perfect fit isn’t always necessary (and sometimes discouraged and it makes it harder to read later). But this approach makes me think carefully about how the system works at it’s lowest level.

A recent change is that I removed all the CLS calls from my game. This clears the screen. But the ROM routine does a lot more than “just clearing the screen”.

Instead, now I’m writing bytes directly to the screen memory which has a near instant effect and there’s no longer a wipe-and-wait delay:



BANK 25 COPY TO 9 :
BANK 10 ERASE 252 :
BANK 11 ERASE %0,%$3000,252 :
BANK 11 ERASE %$3000,%$1000,0: 

The bugs I’ve been squashing have been mostly been subtle issues that (hopefully) make the difference between “okay cool” and “oh, that’s odd”.

Here’s a fun bit of debugging to make sure the footsteps are positioned correctly:

The most recent fix I was most proud of is a control hack. If the player tries to move right, but there’s a wall in the way, it’ll continue moving in the direction they were previously facing until they’re free to move right. This hack means skimming around corners is much more natural – an invisible change to the player, but it felt sticky (or broken) when the player would be stuck hitting wall before a corner.

The outstanding tasks before the game is in a (first draft) complete state are:

  • (required) Game over – Win state
  • (required) Hi-score table
  • (feat) Change colours of tombs between each level
  • (feat) “Get outta there” / “now find the archaeologist” / “find that key!” marquee

Which doesn’t feel too far away!



Source link

Share219Tweet137Share55Pin49

Related Posts

Life with ESM | CSS-Tricks
Web Dev

Life with ESM | CSS-Tricks

ESM, meaning ES Modules, meaning JavaScript Modules. Like, import and friends. Browsers support it these days. There is plenty...

January 19, 2021
Netlify Edge Handlers | CSS-Tricks
Web Dev

Netlify Edge Handlers | CSS-Tricks

Netlify Edge Handlers are in Early Access (you can request it), but they are super cool and I think...

January 19, 2021
How To Build A Node.js API For Ethereum Blockchain — Smashing Magazine
Web Dev

How To Build A Node.js API For Ethereum Blockchain — Smashing Magazine

About The AuthorJohn Agbanusi is a passionate full stack developer, a developer at Meet Kumba and an active open...

January 19, 2021
GitHub Availability Report: July 2020
Web Dev

Git clone: a data-driven study on cloning behaviors

@derrickstolee recently discussed several different git clone options, but how do those options actually affect your Git performance? Which option is fastest for...

January 19, 2021
Next Post
How To Space And Kern Punctuation Marks And Other Symbols — Smashing Magazine

CSS News July 2020 — Smashing Magazine

Improving Chromium’s browser compatibility in 2020

Improving Chromium's browser compatibility in 2020

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Oh Mummy – 20-Jul 2020

Go Mummy – 20-Jul 2020

August 13, 2020
a picture is worth a thousand words, faces, and barcodes

a picture is worth a thousand words, faces, and barcodes

May 24, 2020
How to Clear Terminal Screen in Ubuntu and Other Linux

How to Clear Terminal Screen in Ubuntu and Other Linux

October 27, 2020
“Share the knowledge for free”

“Share the knowledge for free”

July 3, 2020

Categories

  • AWS
  • Big Data
  • Database
  • DevOps
  • IoT
  • Linux
  • Web Dev
No Result
View All Result
  • Web Dev
  • Hack
  • Database
  • Big Data
  • AWS
  • Linux

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In