In my lastest game, super mario brothers, I wanted to put in a few moving enemies. Only one problem, its a scrollers. Is there an eqaution or script that calculates the enemies position of the game is scrolling also? Many people might not understand this. What I am getting at is when you scroll, your x position isn't changing, the background is. If you put a enemy in during stage 3 lets say, it will go through pipes, walls and other obstacles because its not moving with the scrolling, but with the x and y positions. Any help?
Offline
Weel, first find when you want it to show and hide using the If/Else block. Than do this:
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> <{ Enemy movement }> ))[/blocks]
[blocks]<end>[/blocks]
Now, it will set it to a local variable called movement. So, when green flag clicked, set movement to either -480, -480*2, etc. But also, the sorite will be changing it's movement by like 5, so it will start moving

Offline
Hmmmm.... thats sound pretty good. I would have to change enemy movement to a number then, 5+ that number, etc to make it move though, right?
Last edited by newareagle (2008-07-06 13:02:32)
Offline
newareagle wrote:
Hmmmm.... thats sound pretty good. I would have to change enemy movement to a number then, 5+ that number, etc to make it move though, right?
You would need to change enemy movement by first positive number and than a negative number so it actually changes it's X

Offline
Bluestribute wrote:
Weel, first find when you want it to show and hide using the If/Else block. Than do this:
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> <{ Enemy movement }> ))[/blocks]
[blocks]<end>[/blocks]
Now, it will set it to a local variable called movement. So, when green flag clicked, set movement to either -480, -480*2, etc. But also, the sorite will be changing it's movement by like 5, so it will start moving
BLUESTRIBUTE!!! Thtats all i needed to know when i was making my lost traveler game!
Last edited by AlanProjects (2008-07-06 20:09:44)
Offline
AlanProjects wrote:
Bluestribute wrote:
Weel, first find when you want it to show and hide using the If/Else block. Than do this:
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> <{ Enemy movement }> ))[/blocks]
[blocks]<end>[/blocks]
Now, it will set it to a local variable called movement. So, when green flag clicked, set movement to either -480, -480*2, etc. But also, the sorite will be changing it's movement by like 5, so it will start movingBLUESTRIBUTE!!! Thtats all i needed to know when i was making my lost traveler game!
![]()
And I went searchign through the forums quickly afterwards to try and find out how. Now I could do it, though natural looking multi-directional AI's in space is still a little tricky for me

Offline
Bluestribute wrote:
AlanProjects wrote:
Bluestribute wrote:
Weel, first find when you want it to show and hide using the If/Else block. Than do this:
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> <{ Enemy movement }> ))[/blocks]
[blocks]<end>[/blocks]
Now, it will set it to a local variable called movement. So, when green flag clicked, set movement to either -480, -480*2, etc. But also, the sorite will be changing it's movement by like 5, so it will start movingBLUESTRIBUTE!!! Thtats all i needed to know when i was making my lost traveler game!
![]()
And I went searchign through the forums quickly afterwards to try and find out how. Now I could do it, though natural looking multi-directional AI's in space is still a little tricky for me
Natural-looking AI's in space?
Offline
AlanProjects wrote:
Bluestribute wrote:
AlanProjects wrote:
BLUESTRIBUTE!!! Thtats all i needed to know when i was making my lost traveler game!
![]()
And I went searchign through the forums quickly afterwards to try and find out how. Now I could do it, though natural looking multi-directional AI's in space is still a little tricky for me
Natural-looking AI's in space?
![]()
Rofl quite off-topic arent we
Offline
Try some of my scrolling tutorials!!!!!
[blocks]<when green flag clicked>
<forever><set x to( ((((<{ Scroll_x }> <+> (( 480 <*> Where ever )) ) <+> <{ Enemy Pos_x }> )))[/blocks]
Last edited by tro95 (2008-07-10 06:36:43)
Offline