I did another fairly significant amount of rewriting yesterday.
I switched on Use Strict for a bit, and used it to guide me to a few fixes, before ultimately turning it back off again.
Use Strict is the Javascript "Make everything more EVIL!" toggle, and it makes everything evil to the point where nothing would run well at all.
I went through the whole language, piece by piece, fixing up missing variable declarations and such. It was another hefty rewrite of some core functionality, and .. gosh, this past week or so has been a lot of that.
Thankfully I hadn't started that complete scan through all the commands again, because this would've meant yet another restart of the entire list!
So, why isn't Give a Cow a Pickaxe working?
*shrugs*
I'll have to scrub through the code to see if anything obvious sticks out.
I have a feeling it might be the "You no longer need to clear arrays out as much as you used to" optimisation that I did a few days ago, but I can't be 100% sure until I do a ton more testing.
So, things are still a little bit broken. Sorry about that.
I AM trying to get things working better, and in fact I think I've managed another 15% or so speed-ups, over the past few hours. .. Though whether those were an important 15% of code remains to be seen!
(I really should be coding a game, though!!)
Update
It was the Round command. For reasons I can't fathom, Round was converting numbers into strings.
*ugh*
Yeah, I need to go over all the commands again.
Aargh!!!
[chorus]
Every time I squash a bug,
Another comes to take its place.
Is it any wonder why,
I'm starting to lose my faith.
[verse]
How can I make things optimal,
When the bugs spring up from everywhere.
I bring out my hammer and splat all their heads,
But more will spring up from where they are dead.
[chorus]
Every time I squash a bug,
Another comes to take its place.
Is it any wonder why,
I'm starting to lose my faith.
[verse]
The bugs are running, fast and loose,
I aim with a mouse, with keywords as ammo.
Blasting all the evil code 'til all the bugs are gone.
Nothing will stand in my way, when making things optimal.
[chorus]
Every time I squash a bug,
Another comes to take its place.
Is it any wonder why,
I'm starting to lose my faith.
[bridge]
Bug, bug, bug, oh it's another bug.
Bug, bug, bug, squish it, splat, defeated.
Bug, bug, bug, no more will it frustrate.
As I squash all the bugs, until the night is late.
[chorus]
Every time I squash a bug,
Another comes to take its place.
Is it any wonder why,
I'm starting to lose my faith.
[Brian and Sarah are stood proudly behind the counter, while Dave examines a peculiar looking ScrunchCake]
Dave: So what's this one called then?
Sarah: Nutmeg Mania!
Brian: With a special twist.
[Dave tries the new ScrunchCake]
Dave: Is that... is that not normal.. not a regular sausage in there?
Sarah: Cumberland!
Dave: But...
Brian: We thought we'd innovate a bit.
[Dave looks horrified]
Dave: You can't just change the sausage! It's like... it's like changing Tetris blocks to triangles!
Green: It really isn't.
[Dave takes another bite]
Dave: The nutmeg's nice, but...
Brian: But?
Dave: I'm not sure about the sausage. It's weirdly textured. It takes away from the scrunch. It's..
Sarah: Flavourful?
Dave: Exactly! ScrunchCakes need bland sausages, so that the scrunch takes full effect.
Sarah: I thought the cumberland gave it a nice kick. They're slightly peppered, too to match the spice of the Nutmeg.
Brian: We've got another five batches in the back, so we might as well try selling them.
Dave: [holding his head in his hands] Mrs Thompson will have my head for this.
Sarah: I'm sure they'll sell well enough. You never know, Greggs might even steal the recipe!
Brian: Nah, they're still obsessed with pastry. They haven't yet discovered the amazing variations of cake.
Dave: OK, we'll give them a trial run. But only for today.
Sarah: Yeah!
[End credits roll]
Views 49, Upvotes 1
Daily Blog
,
Jse
,
Optimising
New games every week!
Places
Archives
Site credits : All of the above : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed
90
Blog - ☀️- 08 - One Bug Down, Ten More Arrive - AGameAWeek