accessing behavior variables in python

For questions about using Classic.

Post » Tue Feb 01, 2011 3:22 am

I have a sprite with a Bullet behavior. I want to change its speed in python. What is the syntax (if any) to set the variables of a behavior?
B
1
G
1
Posts: 6
Reputation: 437

Post » Tue Feb 01, 2011 7:40 am

If the sprite's name is 'Sprite' and the bullet behavior's name is 'Bullet' then you access the speed property with
[code:plva6ong]SpriteBullet.Speed = 200[/code:plva6ong]

This is a good thread with some hints to PyShell: [url:plva6ong]http://www.scirra.com/forum/viewtopic.php?f=3&t=7231&p=56896[/url:plva6ong]
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Feb 01, 2011 2:46 pm

Thanks for your response. I will add this information to the wiki.
B
1
G
1
Posts: 6
Reputation: 437


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests