Noob question

For questions about using Classic.

Post » Tue Aug 04, 2009 8:34 pm

Hey, I found this by pure chance and its just the type of thing I've been looking for.

After messing with control, reading and doing tutorials, surfing the source forge documentary, and sifting though forums, I can't seem to figure out how to turn a platform sprite to the left without flipping it upside down.

The things I've tried:

Checking auto mirror

On control press "move left" => Rotate sprite (and sprite animation) 180

Messed with angles under the animation tab

On control press "move left" => Create sprite L on image point 1
Destroy sprite R
Creating multiple animations

And lots more, none seems to work right. I've been working with control for a few days, mainly just learning the loops. But this seems like its a fairly important thing to include. Deadeyes platform school was helpful, but the sprite in it didn't flip either. I'm running windows vista 64, with an nvidia geforce 6600 pixel shader 3.0 (I think, I know its at least 2.0)

I thought it might be a compatibility issue, so I tested things around on a laptop running windows XP, and an Intel graphics card (not sure if it even has PS) and I still couldn't solve my problem. I suppose this post didn't need to be so big, but I figured it's better than having to clarify myself over and over.
B
2
G
3
Posts: 23
Reputation: 896

Post » Tue Aug 04, 2009 8:41 pm

Auto mirror should be checked, then you can use the "Compare" condition under system to check the X speed of the object, like this:

[code:1lxe7j41]+Sprite[Platform].VectorX greater than 0
-Sprite: Set angle to 0

+Sprite[Platform].VectorX less than 0
-Sprite: Set angle to 180[/code:1lxe7j41]

Here's a CAP file to illustrate this.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Aug 04, 2009 8:53 pm

Thank you. It works on your example, but I must be doing something wrong, cause it wont work for me. I have one more question whats going wrong in this cap, that it wont let me go to level 1?

[url:c3915ajv]http://rapidshare.com/files/263760774/Gravity_Bricks.cap.html[/url:c3915ajv]
B
2
G
3
Posts: 23
Reputation: 896

Post » Tue Aug 04, 2009 9:26 pm

It's going to the level 1 layout, I think you might have the layouts mixed up, though. The level 1 layout has ten bricks while the level 2 layout has only 1. Could that be the problem?

Also, a suggestion. You should set the collision mode on your menu sprites to bounding box so the mouse doesn't have to be right over the text to be clicked.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Aug 05, 2009 6:29 am

Yet another question from the amitious noob =P

How does system => special conditions => OR work?

I want to make it so that when the sprite is moving left or right, but the directionaly keys are not pressed he performs a sliding animation. How can I do this if I'm using the player[platform].vectorx condition to determine facing direction?
B
2
G
3
Posts: 23
Reputation: 896

Post » Wed Aug 05, 2009 6:50 am

Do you want the character to be able to face the opposite direction he's in while sliding? If that's the case, you'll have to do things a little differently. Instead of checking the X speed, check which key is currently depressed. If the right arrow is down, set the angle to 0, if the left arrow is down, set the angle to 180.

For the sliding, you'll need to check to make sure that neither right nor left is down. You can do that by negating the condition, which you do by right clicking a condition and clicking "Invert condition". As a subevent to that, check if the player is currently walking -- the platform behavior actually has a condition for this. If it is, set the player's animation to the sliding animation.

I'm probably explaining this poorly, so here's a CAP file showing what I'm talking about: Sliding

As for the "Or" condition, you can sandwich it between two conditions. If either of them equate to true, you're event will trigger.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Aug 05, 2009 4:48 pm

Thank you for your help. I have been working hard on a game, and its nice to have someone give me help to maximise the game play.

One last question on charactor movement, is there a way that I can have the speed of vector.x determine the speed of the animation (for running). I know there must be an equasion for this, but I'm not sure how to implement it.

Thanks for all the support. I hope to be proficent soon.
B
2
G
3
Posts: 23
Reputation: 896

Post » Wed Aug 05, 2009 6:08 pm

The animation speed is a simple matter of finding the ratio between the current value of VectorX and the object's maximum floor speed. So, set the animation speed to something like this:

[code:2yjrbm54]abs(Sprite[Platform].VectorX) / Sprite[Platform].MaxFloorSpeed * AS

NOTE: 'AS' is just a placeholder and should be replaced by the maximum speed at which you want the animation to play.[/code:2yjrbm54]
abs() will return the value you specify as a positive value even if the original is negative. This will ensure that the animation speed is never a negative value.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Aug 06, 2009 12:11 am

I'm sorry, does this go in the events, or in the tab that acctually says "animation speed"? :oops:

I've tried both, but I'm not sure how to implement it as a condition and event, and when I try to put it in the animation box it just reverts to what ever the number it had there preveously.

Do you have a cap? I'm more of a monkey see monkey do.
B
2
G
3
Posts: 23
Reputation: 896

Post » Thu Aug 06, 2009 1:14 am

That would go in the event sheet editor. Equations don't work anywhere outside of conditions and actions. The proper place to implement it would be in your "Key is down" events. There you could set the proper animation as well as the speed with the equation I gave you.

Anyways, I went ahead and whipped up a quick CAP illustrating all the things you've asked about so you could see how it can all go together. It shows the mirroring of the sprite, the sliding, and the animation speed.

Platforming examples

I hope all of this has helped you. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest