![]() (There are other options, though, like "x center of self" which puts that point in the middle.) So subtracting the width of self from the scene width will make sure that your actor visually never leaves the screen, because that point it's checking is the left most point of the actor. The reason for this is when it is checking "x of self" it will be checking the leftmost coordinate of self. So now the logic will check to see if you're passed 620 pixels before telling it to stop moving or whatever it's going to do to keep you on screen. "width of self" is similarly a number - whatever the width of the self actor is. If your game's dimension is, for example, 640x480, then "screen width" means 640. ![]() It's just checking to see if the actor is to the right of the screen. Is x coordinate of self greater than (ie, to the right of) "screen width" (which is a preset block which will always be the screen width, so if your game's dimension is 640x480, screen width will mean 640). This one is checking to see if you are to the right of the screen. If it's not true, (ie, if you are NOT to the left of the screen) then the "otherwise if" wrapper will be checked. In other words, if the actor (self) is left of the screen, what's inside the if wrapper will be executed (which is currently nothing). The "othewise if" wrapper will only be checked if the first "if" wrapper wasn't true. so imagine an eyeball going from top to bottom looking at everything in order, rapidly, many times a second. If you put things into the "updating" section (called "always" in that version of stencyl) it's a loop that checks everything every frame. There is no instructions for what to do if that condition is met, those would go inside the wrapper. The image you're showing is asking if the X coordinate (left to right) of self is less than 0 (which would put it off the left boundary of the screen, because 0 is the leftmost coordinate). ![]() I forget the particulars of the tutorial, it's been a long time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |