Rectangle object workaround
xienixs
Member Posts: 17
Oke here is the thing.
I have a motor rider: 2 wheels + frame+person
What I want to do is as followed:
Make the motor rider as an image that is only an image.
The two wheels should have 2 circular collision objects.
The frame will be a simple rectangle collision object
The driver and especially his head will probably be another collision object.
I'm using at the moment the tutorial of how to get different points when shooting at different locations on the object.
I don't want a fully explanation yet as I love to play around by myself. However what I want to know for now is one thing. Is it possible in GS?
I mean that the two wheel collision objects always... ALWAYS stay at that location of the image. Thus even if one wheel gets blocked the image or other objects should not move further. Something like a grouped object.
Also what I noticed is if I for example press Left on the keyboard to let the image rotate. The circles stay at the same X and Y position of the rectangle. Thus if the motor image is upside down the wheels are still at the bottom and not up in the air. Is it possible that they move with the image along?
Thanks a lot...!
I have a motor rider: 2 wheels + frame+person
What I want to do is as followed:
Make the motor rider as an image that is only an image.
The two wheels should have 2 circular collision objects.
The frame will be a simple rectangle collision object
The driver and especially his head will probably be another collision object.
I'm using at the moment the tutorial of how to get different points when shooting at different locations on the object.
I don't want a fully explanation yet as I love to play around by myself. However what I want to know for now is one thing. Is it possible in GS?
I mean that the two wheel collision objects always... ALWAYS stay at that location of the image. Thus even if one wheel gets blocked the image or other objects should not move further. Something like a grouped object.
Also what I noticed is if I for example press Left on the keyboard to let the image rotate. The circles stay at the same X and Y position of the rectangle. Thus if the motor image is upside down the wheels are still at the bottom and not up in the air. Is it possible that they move with the image along?
Thanks a lot...!
Comments
http://www.jjkoehorst.com/wp-content/uploads/roation.png
But as you can see in the picture it does not rotate with the object. Any ideas? I see what i can do about rotating about the central axis but so far I have not yet an idea to solve that
*turned email notifications on*
When I have a rectangle collision object completely horizontal and the round circle somewhere above the middle point. When I rotate the rectangle object the values of the angle should change right? Is it not possible to coordinate this new angle to the circle object to relocate it. So that the circle always stays on top of the helmet.
http://www.jjkoehorst.com/wp-content/uploads/roation.png
As is shown in the first part of the picture...
Because what i basically try to achieve. When the top of the motor image or the left or right side above the wheels hit a collision object the motor should be rest, destroyed, minus points or whatsoever. Only I don't get this trigger so far.
Could you break your 'biker sprite' up into individual items, then control them in GameSalad. You can constrain items to an offset point then track it's angle etc. I've uploaded a really basic example if it's any help.
http://gamesalad.com/game/play/64562
When can you make it down in July for another meet, fella?
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Motorframe:
Constrain attribute: self.Position.X >> To: game.XBodyLocation
Constrain attribute: self.Position.X >> To: game.YBodyLocation
MotorWB (Motor Wheel Back)
Constrain attribute: game.XBodyLocation >> To: self.Position.X+150
Constrain attribute: game.YBodyLocation >> To: self.Position.Y+90
Collide actor of type: Ground 1
MotorWF (Motor Wheel Front)
Constrain attribute: game.XBodyLocation >> To: self.Position.X-150
Constrain attribute: game.YBodyLocation >> To: self.Position.Y+90
Collide actor of type: Ground 1
The thing is now... the front wheel goes perfectly attached to the Motorframe.
The rear wheel doesnt feel like attaching and ignores my constrain attributes completely...
What might be wrong?
For a reason I had to remove my front wheel for a second. And then the rear wheel attaches perfectly.. hmmm will be continued
Anyway... When I have one wheel in the scene editor it attaches to the main frame of my bike. When I add the second wheel to the scene it will attach to my bike but then the first wheel will not attach to the bike anymore... is this a bug? or do I need to do something else to fix this?
Quickly used the image from your demo as this might visualize things better then 2 circle objects and a square object that i am using at the moment.
http://www.jjkoehorst.com/wp-content/uploads/Screen-shot-2010-06-24-at-16.35.50.png
As you can see it does not link up besides the rear wheel then.
Oke i went back to the drawing board and found out that I should play around with 1 object the motordriver and bike as 1 figure. Then setup the collision by rotation.
Thus if the bike is at 90-180-270 degrees and it hits the ground it should be destroyed. Now my final question in this topic is. How to destroy the object when it hits the ground at a range of 80-100 degrees? I tried min/max but could not find something called range(a,b)....