How do I rotate character around a square (pics for details)

Get help using Construct 2

Post » Fri Jan 30, 2015 2:45 pm

I've been doing this game i always wanted to make since i was small, so far im up to level 5 of the game (out of 9) and it's amazing, construct 2 is the best {Thumbs Up} But im having an issue atm with this: (pic describes best)
IMAGE: sorry cant upload it i'll just paste the thing separated, if that still isnt allowed i'll just describe more detailed and hope you guys get it

http : // postimg . org / image / ikfzie51p /

What im having trouble with is telling the game when the character (that is a box more or less, thus has only 4 points) is switching sides of the ground ( which is like another bigger box lol )

i was thinking of changing the gravity to 90 when touching the top part, 180, 270, 0 on the others but im blocked, the character falls off the box/ground before touching the other sprite/part of the box in order for the action to occur... hence this thread!

please help me, if you could, oh mighty gods!
B
5
Posts: 48
Reputation: 319

Post » Fri Jan 30, 2015 2:50 pm

Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Fri Jan 30, 2015 3:11 pm

Hey man thanks for the reply and the tutorial link, that was good stuff, but in the video he is using a round object as ground, while i want a square to act as a solid ground with different gravity degrees on each side (on top have 90 degrees, on other side have 180 and so on)


I think that the tutorial you gave me was close to what i needed but not exactly, do you perhaps have any other ideas?
B
5
Posts: 48
Reputation: 319

Post » Fri Jan 30, 2015 3:15 pm

Here I just threw this together really quick. Let me know if its what you were looking for. Should help you get started. Let me know if you have any questions.
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Fri Jan 30, 2015 3:33 pm

Yes, could you post pictures of the example because i am at work at the moment and can't load the file and see it from this pc

thanks anyway, i hope it's what i need
B
5
Posts: 48
Reputation: 319

Post » Fri Jan 30, 2015 3:51 pm

got my brother to turn on my pc and try the thing and tell me what the result was, he is helping me with the project, and he told me that looking at the code it seems to do what it should but it doesnt work with a square, because you fall off the edge before switching the degrees of the gravity, in your example you're using an L shaped thing, which works because you dont have to "free fall" in order to touch the other sprite, on a square it is different because you have to somehow rotate at the edge in order to change gravity i suppose you could use an invisible sprite on the edge to tell the character to rotate to the other side of the square and then on touching the sprite of that side the character would get its degrees of gravity, but i wouldnt know how to do that!

anyway thanks for all the support, i hope we can come up with something
B
5
Posts: 48
Reputation: 319

Post » Fri Jan 30, 2015 4:50 pm

ok thatserafimkid i edited what you sent me and here's what it should look like.
http : //postimg . org/image/84cjq3m7p/

i tried adding 2 invisible sprites at the edges to rotate the char but, although that works, the chances of him falling are really high, you have to actually keep pressing a key towards the center of the square in order for him not to fall off during the switch of sides, which is something i'd like the player not to worry about!

any ideas?
B
5
Posts: 48
Reputation: 319

Post » Fri Jan 30, 2015 7:24 pm

Bump, is this impossible? &.&
B
5
Posts: 48
Reputation: 319

Post » Fri Jan 30, 2015 9:08 pm

Here, this should get you going in the right path. Just a tip use @thatserafimkid , or who ever you are speaking to so they get a notification that you replied to them,
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Fri Jan 30, 2015 10:02 pm

thatserafimkid wrote:Here, this should get you going in the right path. Just a tip use @thatserafimkid , or who ever you are speaking to so they get a notification that you replied to them,

@thatserafimkid man you are a mad genius, really, that is EXACTLY what i had in mind!

I don't want to just copy/paste the code tho, it would be nice if you could explain alittle bit what you did!
Out of all the commands you used here's the ones i am unfamiliar with or just have questions about (if you want to answer them that is lol)

(starting from top to bottom of code)
Inside Marker : Sprite2.ImagePointX(1) and Sprite2.ImagePointY(1) what is image point referring to?
Also, is the inside marker needed of is it for details? (from what im understanding it's just a nose, a very well programmed one lol)

on the left marker / right marker overlapping x: Self.Angle +10 where do you find this code, as in is there a page i can find specific codes like Self.Angle you used? (it seems rather interesting and expands the possibilities)

Sorry if im wasting your time, but you just blew me away with how well this is executed!(and fast too)

Side note: when jumping from the top part towards the edge and passing it, it is expected to fall on the other side just like when you walk there, instead the char falls off the map without attaching successfully to the other sprite (test by going right and jumping, you can see he falls instead of rotating and changing his gravit towards the sprite beneath it)
I'm going to try and figure it out on my own, im thinking of using some sort of invisible wire to tell when the char is jumping and doing that specific jump that bugs the mechanism and makes it fall off the sprites and once triggered it will rotate the char just like on the ground
i'll post some updates if i ever do manage to haha (hope this is as easy as it sounds)
B
5
Posts: 48
Reputation: 319

Next

Return to How do I....?

Who is online

Users browsing this forum: el3um4s and 8 guests