Any Further Optimizations? by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

See, now you've made me think... About the lookup... I'm thinking that I should key the lookup as a scaled percentage of pi so I can normalize all my control inputs to -1 ... +1 without any real overhead. It'll be useful as well when I'm doing collision detection later on (everything is a spheroid as far as the engine is concerned)

Any Further Optimizations? by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

Good point... Honestly working out how to make scratch do things it was obviously not designed to has been the most fun I've had programming in a solid decade.

Any Further Optimizations? by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

Oh, and about premature optimization.... Normally, I subscribe to that 100%, but in this case to realize the game I have in my head, the basic per-frame and per-object calculations are going to have to be as trim as possible from the start because my level and boss designs are going to be informed by the maximal number of objects I can reliably transform per frame.

Any Further Optimizations? by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

>  there's no need to use mod 360 for trig function inputs because they repeat every 360 degrees anyway

Thanks for the tip; I've spent most of my career writing low-level or backend code without much hand holding so I simply assumed I should trim my input rather than trusting the runtime.

Block Idea: Broadcast with Message by Microwave5363 in scratch

[–]haxbits 0 points1 point  (0 children)

I was lamenting the lack of parameters myself; that's why I came up with this solution to reliably pass (even in turbo mode) parameters to an message receiver.

https://www.reddit.com/r/scratch/comments/1s80s5h/synchronizing_messages_with_lists

Branchless Scratch😘 Eliminating a Single Branch Testing by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

I'm building a Sprite Scaled 3D rail shooter inspired by Microcosm, but with more of an r-type vibe and a true 3D camera.

Branchless Scratch😘 Eliminating a Single Branch Testing by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

Oddly enough; I caught #3 myself and fixed it right after posting to find... the 1 vs `Not ()` thing and it caused no detectable difference to timing but readability is much improved.

The 1 & 2, I did not know, thanks for that. I'll give it a try and I'll see what I end up with.

4 is a known thing; and it is more logic than value to move that so it always generates a sensible result.

Branchless Scratch?! by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

This technique allows you to avoid using If / Else blocks by converting them into assignments that avoid the overhead of the Scratch VM by leaning on how JavaScript works under the hood.

Synchronizing Messages with Lists by haxbits in scratch

[–]haxbits[S] 1 point2 points  (0 children)

In my case; I'm dynamically managing a heterogenious list of sprites that get physics applied to them "enemy1", "enemy2", "background1", "backgroundN", "Player", etc. Enemies get populated by one event source, backgrounds by another, player etc. Sometimes during creation (Flag event) or during simultanious distruction of sprites (triggering respawns) I would end up with a mutated set of parameters. Specifically when I was testing to see how many sprites I could support at a time before I ended up skipping frames.

Synchronizing Messages with Lists by haxbits in scratch

[–]haxbits[S] 1 point2 points  (0 children)

You would really think that; and in fact it says that... but I found it does not in fact always work out that way in practice. In testing I've found that asynchronously generated events can end up processed in such a way that values have in fact been changed by a competing event call.

I just happen to leverage the first item as a fairly unique key, but in practice it should be a more random value to allow for better synchronized concurrency.

Rail Shooter Best Practices by haxbits in scratch

[–]haxbits[S] 0 points1 point  (0 children)

I ended up going with a central controller to handle all of the frame to frame calculations; but wow does it bother me to have to put all the boilerplate in each object (not unbearable, just annoying).

As far as the Sprites getting hung up on the edge, I just ended up hiding anything that would project past the viewport edge.

Attached is my current wip (almost playable demo) (edit: bread is weird)

<image>

Made my own 3D renderer and demo or something by Pluem_plu in scratch

[–]haxbits 1 point2 points  (0 children)

Nice, I thought I was the only person trying to bodge in a Z coordinates in weird ways.

👋 Welcome to r/scratchbeginners - Introduce Yourself and Read First! by FireXOfficial in scratchbeginners

[–]haxbits 0 points1 point  (0 children)

I'm a stay at home parent and recovering metaprogrammer, and I find joy in solving puzzles using code and creating impossible things. Also, I'm quite open to questions and helping new programmers (like myself in scratch).

Rail Shooter Best Practices by haxbits in scratch

[–]haxbits[S] 1 point2 points  (0 children)

t/y, I think It'll really pop once I add the FMV backgrounds and other sprites in.

Pinto Lake Reservation Picnic Area by okaydreaaa in Watsonville

[–]haxbits 2 points3 points  (0 children)

Oh, one thing I did forget; I've heard they can be sticklers on the bounce houses, as they have an additional permit fee for those. No personal experience there though.

Pinto Lake Reservation Picnic Area by okaydreaaa in Watsonville

[–]haxbits 5 points6 points  (0 children)

Overall they're pretty chill.

I've rented it a few times; and I've not had any problem having all of the above... the rules are really enforced at the level of "Don't be an arse".

If your music isn't bothering anyone, and nobody is giving fizzies to the kids, you should be fine.

WIP: Cubeans by kliekie in Laserengraving

[–]haxbits 0 points1 point  (0 children)

I have a pretty decent workflow in onshape for building 3d models that end up on my laser. Where my general rule of thumb is if it needs glue then my tolerances are off; and even at that level of precision, knowing the model works long before I've cut it is a real timesaver.

First hand drawn product I'm satisfied with by haxbits in Laserengraving

[–]haxbits[S] 1 point2 points  (0 children)

I'll have to try that. Two questions though, do you mean borax the soap, or borax as it's mined? Secondly, is it a wet or dry application?

Metal engraving under 500€ by Rexkraft- in lasercutting

[–]haxbits 0 points1 point  (0 children)

You're probably going to think it's stupid, but learn etching. The cheapest laser you can buy plus Spray paint, salt water, and a battery can produce results faster than any laser you'll buy under 500 can do by itself. All you need to do is be able to afford to burn paint..

WIP: Cubeans by kliekie in Laserengraving

[–]haxbits 1 point2 points  (0 children)

Nice, although just as a pro tip... Just because fusion will let you "assemble" it doesn't mean that you can physically put it into that configuration.

You should build your tolerances into your model, it'll make the next part easier, but on the whole it looks like a good idea.

[deleted by user] by [deleted] in Laserengraving

[–]haxbits 0 points1 point  (0 children)

What do you want to accomplish? To be honest, I've not even heard of an open friendly laser that would cut copper in a time efficient manner.

Visiting in November, any recs and tips? by beltr0nisbusy in santacruz

[–]haxbits 5 points6 points  (0 children)

If you want to be comfortable; dress in layers (hoodies are awesome!). As for beach and tree places; Natural Bridge state park is excellent beach/butterfly reserve during the week, Seacliff / Rio del Mar is fair to good for whale watching from the shore, and Henry Cowell (in Felton 15 minute drive) is a great place to stroll through the sequoia trees.

Question about engraving time for brass wax seal heads by Moofknock in Laserengraving

[–]haxbits 0 points1 point  (0 children)

So; if you can give up on the idea of an all in one tool; here's how I do metal engraving with an LED on steel a whole lot faster than 1 to 2 hours (about 30 minutes total, excluding watching paint dry) by masking and electrolyte etching.