Object creation problems

For questions about using Classic.

Post » Tue Apr 19, 2011 1:18 pm

Hey, I have a problem. I dont know how to change objects which I place. For example on left click I am placing "wooden crate" then I press "shift" and on left click I am starting to place "steel crate". Any suggestions? Thanks for attention.
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Tue Apr 19, 2011 1:27 pm

a little vague on the details, but if I'm understanding you
it should work like this

Mouse/Keyboard - On Left Click
-----Mouse/Keyboard - Shift Key is Down
---------------System Create Object "wooden crate" at mousex,mousey
-----System - Else
---------------System Create Object "steel crate" at mousex,mousey
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Apr 19, 2011 1:29 pm

Close. But... I mean when you press shift it changes the object which you will place.
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Tue Apr 19, 2011 1:53 pm

But that's exactly what lucid's example does :)

Or do you mean, you have a list of e.g. 20 different objects, and you want to loop through them? Then just create an array "names" that you fill with the names of your objects, and a global variable "selector"
then do:

+ On key Shift pressed
-> Add 1 to global 'selector'
++ Is global 'selector' greater than 20
-->set global 'selector' to 1

+ On left click
-> create object names(global('selector')) at mousex, mousey
(this is the action "Create object by name")
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Apr 19, 2011 1:56 pm

Yes! what I needed thank you very much! :)
B
11
S
3
G
6
Posts: 193
Reputation: 4,234


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests