05-03-2018, 09:34 PM
(This post was last modified: 05-03-2018, 09:35 PM by VinnyVideo.)
Pedigree's method would be a good way to do it. You could actually make it so you could place as many dumbbells in the room as needed.
Here's what I would do:
In the bar's Step event, you'd make sure that the leftWeight and rightWeight instances move at the same speed as the main object.
Does this make sense?
Here's what I would do:
- First, I would create a "bar" object. This is the object that you'd actually place in the room. It wouldn't have a collision event with the player.
- I would also create a "weight" object. This is the object that would actually hurt the player, so you'd need to put something in the relevant collision events.
- In the bar object's Create event, you'd create two weights. (This is the GM 8 syntax, but GM Studio 2's is pretty similar):
Code:
leftWeight = instance_create(x-32, y, obj_weight);
rightWeight = instance_create(x+32, y, obj_weight);
In the bar's Step event, you'd make sure that the leftWeight and rightWeight instances move at the same speed as the main object.
Does this make sense?
Course clear! You got a card.
![[Image: CourseClear.gif]](https://dl.dropbox.com/s/d5mcpm4nmt0gd14/CourseClear.gif)
![[Image: CourseClear.gif]](https://dl.dropbox.com/s/d5mcpm4nmt0gd14/CourseClear.gif)