How to make some custom shapes easily without images


#1

I am making a game, where I am going to need a square, that can move at different speeds, seamlessly, that has rounded edges and I am wondering if there is any simple way to do this. Is there a way? If so, thanks.


#2

Maybe everyone should take away things topictooo huh huh huh huh


#3

wut do u mean Nancy


#4

This seems to work well enough.

It’s a square object with the bold text rule, except the set color block was removed.



Here I have the original object always going to the finger. I recommend moving only the original object, which is clone index 1.




Hope this helps.


#5

lol nice workaround


#6

Thanks! That will be helpful. Just a teaser, my project is for the Christmas competition. :smile:


#7

You are very creative; I could have never thought of that :clap: :clap:


#8

I agree. Great solution!


#9

Thanks again, but is there a way I could make a shape look like this:
image
but able to be one object, but still able to be cloned as many times as you like. For example, if I wanted to make 15 of these shapes, all using one object, how would I do it? Thanks. And it also needs to be able to move seamlessly, but it could just move upwards, because I don’t need anything else.


#10

That’s what the subscription is for! Otherwise, there’s work arounds but not with one object.


#11

Come on! That is really REALLY annoying. Sigh… There are two main reasons I don’t get the subscription. One, it costs money. (Duh.) Two, I like the challenge of making everything with basic shapes, not just putting in a picture, because in my mind, that kind of ruins it. I’m sure I’ll work something out.


#12

I wasn’t questioning why you’re not utilizing the subscription, but rather answering your question of how to make the shape using only 1 object. It may be annoying, but that’s just how it is.

I like a challenge as well (That’s one reason I like “unwinding” by playing with Hopscotch code. It’s limitations make it really difficult to do some things that could otherwise be easy). It’s just a matter of how one wishes to spend their time. I.e., coding a gumdrop shape or making a project that uses a gumdrop shape.

In any case, here’s an example of creating multiple gumdrop shapes that act independently using the same set of clones. It extensively uses the Modulo math operator (each gumdrop requires 12 clones of 2 objects, one for the body & 1 for the outline). To simplify the code, original objects are not graphically used, which is why you’ll see (clone_index - 2) in the Modulo instead of (clone_index - 1). So when you see ((self)Clone_Index - 2)%12 (not)= 0 that’s kinda like saying “original object” for each set of clones needed to make 1 shape. The text objects are changed to rectangles for the bottom of the shape and circles of exponentially decreasing size & elevated Y position to make the top. The get the groups of clones (for each gumdrop shape) to act independently, requires “intraframe communication”. Meaning the variables (TempX & TempY) used to pass the positional data could change many times during every frame (and the objects and rules have to be in the right order to receive the right values).

So, yes, it can be done (with 24 objects per shape)… but it’s not easy. And you pay a lag penalty as you’ll note the FPS start to drop as the number of Gumdrops increases.


#13

You could also go to sites like coolsymbol.com and see if they have the shape you need in text form.


#14

Thanks @MyPizza, I have thought of a way, using text objects, that works (almost) perfectly. It looks seamless, and it moves perfectly. I have a rectangle text, and a semi-circle text, and they move together. The only trouble is that I don’t know how to do tap detection of when either one of them is tapped, the other one disappears. Inter-clone communication, specific for different clones? Thanks to you as well, @ThinBuffalo.


#15

Assuming the 2 text shapes are always paired together with the same clone index of the other shape… you’ll just need to one to “broadcast” or “advertise” it’s clone index to the other using a global variable.

Add this custom rule to both objects:

{Custom rule} Hide clone pairs when tapped
    When (self) is tapped
        Set PairIndex to (self)CloneIndex
        Set PairIndex to 0
    {End when}
    When PairIndex = (self)CloneIndex 
        Set Invisibility to 100
    {End when}
{End Custom rule}

#16

Hmmmm… My system doesn’t work like that but I’m sure I could modify it to make it work. Thanks again!