Destroy variable block

A feature I’d like to see in hopscotch is: Destroy variable block

it would be useful for: stoping the flow of a variable in a convenient way

I’ve seen things like these in other coding languages: I haven’t

Here’s an example picture:
image

It would be pretty useful in games where you want to reduce lag and get rid of no longer useful variables

14 Likes

How would destroy variable work?

Could you instead do something like this?

5 Likes

I’m guessing it would delete values at a certain point of a project- when they’re no longer needed

and hey @Pickel- moved it!
let’s me know if you’d like anything changed or edited:)

6 Likes

I don’t think variables cause lag though…

8 Likes

Variables aren’t the biggest source of lag - but I get the idea! Thanks for submitting it, because now, THT can consider it, and they will probably put into consideration how much variables impacts project performance :slight_smile:

5 Likes

That makes the variable still existent

The objective is to get rid of it so it doesn’t take the bits of space it used before

4 Likes

Variables aren’t that laggy

Clones are

3 Likes

This would be nice, or even just a way to delete variables from the editor would be nice

3 Likes

yes

3 Likes

But how would you get rid of it – how would it deal with reading a deleted variable? And why mid-game? Variables don’t even cause lag

5 Likes

Destroy destroy blocks are my fav!

1 Like

Yeah, that part didn’t make sense…


Why is this needed tho? It has no real benefit, and comes with a very confusing coding experience imo. What’s the difference between this and when 7 = 7 set variable to 0?

1 Like

It could be useful, although a Decrease Variable by ____ would be more useful.

2 Likes

nice idea!


you can do that using

increase (variable) by (-1)

Decrease variable by ____ would decrease the time it would take to do “Decrease Y by X” because without it would be “Increase Y by 0 - X.” It takes longer to code.

2 Likes

what’s the matter?

1 Like

Sometimes it gets frustrating to code many blocks that decrease a variable by another to some extent.

2 Likes

Clones running the same code with the same variables are top

1 Like

I mean too

1 Like

Increase (variable1) by (variable2) • -1

2 Likes