so restricted .. >>(o.o)<<

For questions about using Classic.

Post » Sun Nov 18, 2007 9:27 am

well, lets say i want to make something move forward. the only way i know how to is add 'car' to the movement..but i dont want all the other stuff that comes with the car. isnt there any way at all to do what the 'car' movement thing does, but individualy?


also, in the boxes where i must insert variables, for example when i hit the right arrow i want my object to rotate. in the X and Y boxes, what ppossible things could i put in there? i know numbers and negative numbers are alowed, and mouseY/mouseX is. what other imputs are available?
B
2
G
5
Posts: 22
Reputation: 1,294

Post » Sun Nov 18, 2007 11:14 am

First you will need to add a Mouse&Keyboard object to your program.
Since you're making a custom movement for your object, remove any movement plugins you have added to it.

Then in the Event Sheet Editor, make a new event to check for controls being pressed:

1. Right click the Event Sheet and select "Insert Event."

2. Double-click the Mouse&Keyboard icon and select "Control is down." Click Next.

3. Type the name of the control to check for in between the quotes. (The default key controls are called "Move Left," "Move Right," etc.) Your condition is now set up.

4. Now click on "+ New Action" next to the condition.

5. Double-click the sprite you want to move.

6. Scroll down to "Size and Position" and select the appropriate Set command. For instance, if you want to move left or right, pick "Set X."

7. A new window appears asking for the new X coordinate. We want to add to the coordinate while the key is being held down, so we need to call the current coordinate. Delete the "0" in the box and double-click your sprite.

8. Scroll down to Size and Position and select "Get X." Click Finish.

9. Now you will see the name of your sprite in the New Coordinate box. (You can type this in manually if you want, instead of clicking to pick your sprite.) If the player is pressing right, we want to add to this value. type in "+5" (without the quotes) after spriteName.X. Click finish.

Your event is done. Now every time you hold down the right arrow, your sprite will continually move five pixels to the right every cycle.

You can rotate the sprite the same way. Just create a condition, and in the new action choose an option under the sprite's Angle section.

Hope this helps.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Nov 18, 2007 11:34 am

yes, it does, but what about top down 360 degree movement, thats what got the better of me
B
2
G
5
Posts: 22
Reputation: 1,294

Post » Sun Nov 18, 2007 2:49 pm

If you want say a top down guy walking around, you're best off doing what Ghost Shooter does: an 8 direction movement, and then Always set the player's angle towards position MouseX, MouseY. Then you can easily move in any direction whilst looking in any direction. If that doesn't suit your game, you'll have to describe better what you want.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Nov 18, 2007 6:49 pm

[quote="Tidus97":37dsuzqa]yes, it does, but what about top down 360 degree movement, thats what got the better of me[/quote:37dsuzqa]

I made a tut for you. http://scirra.com/phpBB2/viewtopic.php?p=1482
B
2
S
2
G
5
Posts: 512
Reputation: 2,674


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest