Understanding physics and trouble grouping


(Tom) #1

Hype game example.hype.zip (17.5 KB) Hi everyone, I am quite new to Hype and run into some funny problem: I was playing around with the physics in a small game, and can not find out, how you can prevent the ball from going through walls. I set density to 100, but I can still squeeze the ball through the wall. Why? How can I assure, that my ball does not disappear?

As you may notice, the construction for my cursor does not work properly. The cursor is made from copying on element three times and making some small modifications. While 2 parts behave as expected, the third part managed to get some “offset” parameters. Somehow I got lost, how to spot this “offset” (and how to get rid of it…) It might be, that I have not understood the “Group” command properly. I expected to create elements, group them and then define their common behaviour. But what happens to the behaviour, they got before the grouping? I did not succeed to find a tutorial for this topic. Is there a friendly soul, that can help?
This "grouping"issue of mine might also answer my offset problem.
The funny thing is, that the behaviour of these three elements changes in a not very predictable way. Sometimes the group behaves as a it should, all three elements stay together and follow the cursor. Sometimes one of the small elements starts to orbit around the other. And sometimes (after clicking outside in the field) the cursor changes its shape… I am sure this might be the beginning of a very sophisticated game, but I would just like to remain in control of whats going on ;o) Any good hints? I will try to attach the file… Best regards, T.


(Andrew) #2

The first issue i found was because the group box was bigger than that borders, if I close that group box (in yellow) to the same size of the scene it does not pop through.

The second, the cursor seems to be based on where you click. If you click on just the bottom rect then it works fine. So I would look at how the cursor is constructed :smile:


(Tom) #3

Hi Andrew, thanks for the response. Even if i make the group box same size/ slightly smaller than the frame, my ball manages to get through…? Somehow I need to have the physics inactive for the frame, don’t I? Setting it to “Static” would make more sense, but the ball disappears immediately in preview, since it is “In the frame”. Is there a way to invert the physics there?


(Andrew) #4

It jumped out of the box, left bottom when the group (yellow group box) was wider than the actual rect elements, but when i closed them, I did not pop out. So I am sure why it pops out on yours. Ill have another look :smile: and get back to ya :smile: