sprite positioning

For questions about using Classic.

Post » Wed Nov 28, 2007 5:30 pm

i'm trying to set the y position of my sprite relative to itself with the following

(Sprite.Y) + (Sprite.Value("y direction"))

gives me the error

Error in parameter 1:

Parameter 1 of'Sprite.Value' does not take 'String'


i just found out that it doesn't take string quotes "" rather character quotes '' ... hmm
B
2
S
2
G
5
Posts: 293
Reputation: 2,236

Post » Wed Nov 28, 2007 5:41 pm

Use ' instead of ".
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Wed Nov 28, 2007 5:54 pm

Ah! that helped me solve some problems i had too! Thanks!
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Wed Nov 28, 2007 6:13 pm

[quote="Arima":3oy2r1k6]Use ' instead of ".[/quote:3oy2r1k6]

yeah, i figured that out while i was making the post but instead of scrapping the post i included the solution for those who do not know about this :P
B
2
S
2
G
5
Posts: 293
Reputation: 2,236

Post » Wed Nov 28, 2007 8:07 pm

Ah, sorry - I read the double ' you wrote as one of these ".
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sat Dec 01, 2007 8:21 pm

Yeah before 0.86 Construct would have let you use double quotes, but because that's wrong, it'd have always accessed the first private variable no matter what the string said. 0.86 forces you to use the correct single quotes. If you type Sprite.Value(', you should get an intellisense type popup with a list of all the private variables too.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests