Use pen for destructible ground to reduce lag


#1

https://www.tynker.com/play?p=57a7ae0365e4f211528b4572

This is a watchable demo.
You may have noticed how slow all the 2D minecraft games made on Hopscotch lag a lot.
This is because of all the texts/objects being used.
I'll explain how to use pen to make destructible ground and still have minimal text for a character to stand on.

In this demo 20 dot clones are made along the screen bottom.
They move up 2 pixels when made drawing a brown trail/circle.
When the distance from the characters y position to the clones y position is less than 40 and the characters x position is less than the clones x position + 20 and greater than the clones x position - 20, the clone draws a white trail up/down to delete the brown circle it made and then the clone hides. The character can stand on the dot clones while they are visible. This is just advice for making pen objects that can be destroyed and still be detected until destroyed.

I hope this helps and gives ideas


#2

Great topic!!

(Why do you have no crafts picture that's says MC?)


#3

I don't know what u mean?


#4

Ha!! You changed it!


#5

Cool trick! This will be super helpful :D


#6

Thanx Malie :slight_smile: !!!!!!


#7


https://c.gethopscotch.com/p/y5vviw247

Here is the Hopscotch version.
If anyone wants to know how to do it.
@MobCraft
@AHappyCoder
@Gilbert189


#8

I'll have to check le code.


#9

Ooh that is a cool way to make the illusion of an 'object' disappearing! I will definitely keep that in mind for use sometime (will give you credit of course :slight_smile:)