Be so nice to download the .zip from previous post.
Unzip it on a handy place.
OK.
Its time to leave the basic objects for what they are.
Lets add a sprite to the layout.
Make a new Construct direct X game.
Navigate to the layout editor.
Double click an empty place in the layout to bring up the new object wizard.
Choose Sprite from the objects.
Again you get a cross hair cursor. Click in the layout where you want the object to appear.
And the picture editor will show up.
The picture editor is very well explained on the wiki. There is no way i could explain it better.
Since i only use it to bring in the graphics i did outside construct and to set imagepoints.
I have a long resting love affair with Photoshop, Imageready, After effects and Illustrator.
Now on top of the picture editor you find the second icon. When you hover your mouse over it, it says "open".
Click that to open a graphics file and point it to the folder with sprites i provided.
Double click "info.png" to open it in the Picture Editor. Or when your system hides extensions, double click "info" to open it in the picture editor.
Close the Picture editor as u close any window. It will ask to save. Click "yes"
Now you have a new object in the layout.
Name it "info". Always give every new object a name.
And this is how easy it is to bring graphics into construct.
Sprite ? Object ?
Everything in the picture editor is a sprite.
Everything in the layout is an object and one of the many properties of this object is its face, the sprite. Which can be an animation, but thats for later.
There are faceless objects too. One of those we saw already. The system object.
Now lets rotate the object info with a basic behavior.
Uncollaps the behaviors tag in the left plane, the properties plane. Add a new behavior "Rotate".
Leave the values as they are.
And run .
As you ... it rotates !!!
Again with no events, no programming skills, no complicated code ..
we gave movement to an object.
Now lets combine this the last tutorial about the bullet behavior.
Add a new sprite to the layout. And choose "plane.png" from the sprites i provided.
Place it exact in the middle of the layout. And name it "plane"
Hmm exact ?
Ah well yes, we know that the layout is 640 pixels x 480 pixels.
You can see this by clicking on a empty spot in the layout. The left properties plane will give the properties of the layout. And there is width = 640. Height = 480
so the middle is
x = 640/2
y = 480/2
You can fill the results of this in the X and Y properties of the plane object. And it jumps to the middle.
(select the plane, uncollaps common, change X and Y )
But let me introduce you to another very nice feature of the layout editor.
Its Grid.
Click on "layout" on the top menu.
The ribbon will change to layout related buttons.
Click on edit grid in the ribbon.
Ah little window pops up.
fill in the horizontal the number 64.
fill in the vertical the number 48.
click ok
click in the ribbon on "toggle grid" to make the objects snap to the grid.
Now it is very easy to move the plane to exact the middle of the layout.
Ah yes construct has very nice features. Only.
At this moment (.95.3) the grid will return to its initial state of 16x16 when you reopen this project.
OK now, give the plane a bullet behavior, as explained in the previous post.
Leave all values as they are.
But toggle the "destroy when" to "never"
now move to the Event Sheet Editor.
Add a event with a system flow condition "always"
Add a sub-event with a system flow condition "always"
Add an action to the sub-event.
The action wizard shows up. The wizard usually comes in 3 steps.
Step1: the base object for this action. Or better said. The object that will be addressed when we use a "self expression" like
".angle"
".X"
".Y"
choose plain. (double click or select and click next)
Step2 : The actions show up. And thats pretty all you can "DO" with this object.
choose "Set Angle"
Step3: The parameters for this action.
fill in info.angle
You again will notice another way of construct helping you.
At the moment you type the point, construct will pop up a list of all accessible properties for the object "info".
Nice .. no ?
The events should look like this:
<img src="http://usera.imagecave.com/j0h/construct/34_plane.jpg">
Now what have we done by this ?
We just set the angle of the plane to the angle of the info.
The info rotates by a behavior. In other words, its angle is animated.
The Plane moves by a bullet behavior direction its angle.
Since the Plane's angle will change according the info's angle,
the plane will change direction and fly circles.
Run all to see this.
Pretty simple to accomplish in construct. Dont you think ?
Now lets explore the next basic movement. And this way to move objects you will use A LOT.
Trust me on this.
Add another sprite to the layout. This time "balloon.png" from the sprites that i provided.
Name it "baloon"
Place it anywhere in the layout. Yes it snaps to the grid.
Add an action at the last "always" sub event.
step1: baloon as object
step2: "set position to another object" as action
step3: the parameters .. select the "plane" as object to position to, leave image point at 0
the events should look like this
<img src="http://usera.imagecave.com/j0h/construct/35_snap.jpg">
Run it.
As you see, the balloon moves the same way as the plane. Without the rotation.
We will use this A LOT. By instance for our own sensors. But that is for later.
So far, we did a lot with construct. With basic behaviors, and basic events.
As you see, with a little guidance, construct is really simple.
And, although construct is beta, we had no crashes yet.
next post will be a little break from moving objects, it will be about "picking objects".
yuck that will be a long post.
Is anyone reading btw ?