Use a variable to store the state of each key you use and update them with keyboard and touch events. Then in the rest of your event just compare their value to see the state.
How about one key with an array.AsJSON saved into it, where the array has all the level info in it.
You could do lasers like this in post:
http://www.scirra.com/forum/laser_topic44612_post279569.html#279569
Make it work for multiple lasers by add a "for each laser" to the top of event two.
You can adjust event two so that you get better performance by decreasing the repeat count and increasing the amount you lengthen the laser. It's just a balance between performance and accuracy, but also keep in mind that both numbers multiplied together also define the range of the laser. In the example the range is 30*20 or 600 pixels.
Here is the utility:
http://dl.dropbox.com/u/5426011/utility/addobjfix.zip
To use it put it in the same folder as your cap file and before you run it change this portion of the script:
#------------------------ #------------------------ # change to your filename. filename='wewe1.cap' #------------------------ #------------------------
so that filename is your cap file and not 'wewe1.cap'.
There is no object limit, what you are expiriencing is a bug (did you copy objects from another cap?)
I made a utility to fix caps that do that, I will find a link to it tommarow and post it.
I was trying to make the text look like events. Sprite1 and Sprite2 are just the names of two different object types, and all I'm proposing is to add the objects to a family, add a family variable, and then for each object type set the family variable to the same value as the instance variable. At that time you can do the for each ordered solution with the family.
The simplest way would be to put the objects in a family and add a family instance variable z2. Then you could do this:
every tick:
sprite1: set z2 to self.z
sprite2: set z2 to self.z
for each family1 ordered by z2:
It's working here, I added more instances and they still worked as intended. If you create them at runtime you need to set the distort map size before displacement will work.
Develop games in your browser. Powerful, performant & highly capable.
crowtongue here is the newer version:
http://www.scirra.com/forum/construct-classic-r2-released_topic48884.html
I'd try adding a "for each" condition to the end of event 220. If that doesn't work it's likely the else's that are causing all of them to be picked. In this case you can easily fix it by removing the elses and putting the inverted conditions of events 221 and 222 into event 223.
How's this?
http://dl.dropbox.com/u/5426011/examples14/path.capx
Of course you could simplify it by replacing event 2 with some events that just add/subtract from sprite.dist to move left/right on the path.
For 360 degrees just use
angle(target.X,target.Y,mouse.X,mouse.Y)
For 90 degrees use this (modify the bold for any other range):
clamp((360+90+angle(target.X,target.Y,mouse.X,mouse.Y))%360-180,-45,45)+90
Member since 15 Jun, 2009