I Need To Figure Out How To add Scrolling Enemies, I need to make it so if i touch enemies I get hurt but not die, how to get touched and die, how to make it so if i jump on an enemy and they die, Etc., Etc., i tried this for the enemy dies if you jump on it: <if><touching[ sprite10<hide><< <and> >>[/blocks] and have it so if x position of my character = X (AKA any number) it dies, and it does not work.
Offline
try this:
[blocks]
<when green flag clicked>
<forever>
<if<< <touching[ sprite 10 <and> <( <y position> <=> (( yposition of sprite enemy sprite <+> what ever your sprites y position - the enemys y position )) )> >>
<broadcast[ enemy dies
<end>
<end>
and this in enemy:
<when green flag clicked>
<show>
<when I receive[ enemy dies
<hide>
[/blocks]
Offline
terminator355 wrote:
try this:
[blocks]
<when green flag clicked>
<forever>
<if<< <touching[ sprite 10 <and> <( <y position> <=> (( yposition of sprite enemy sprite <+> what ever your sprites y position - the enemys y position )) )> >>
<broadcast[ enemy dies
<end>
<end>
and this in enemy:
<when green flag clicked>
<show>
<when I receive[ enemy dies
<hide>
[/blocks]
Thank you. I will try that.
Offline
[forever]
[if < <(scrollX) < (enemyX) + 240> and <(scrollX) > (enemyX) - 240>>]
[show]
[else:]
[hide]
[set X to ((enemyX) - (scrollX))]
-------------------------------------------
this is the actual location scripting
-------------------------------------------
[forever]
[if <(scrollX) > (enemyX)>]
[change enemyX by (5)]
[if <(scrollX) < (enemyX)>]
[change enemyX by (-5)]
--------------------------------------
this is the movement script
--------------------------------------
this is enough AI stuff to make the enemy come towards you, I suppose you already know how to do sensing for if it needs to fall to the ground or something
Last edited by dingdong (2008-08-20 16:03:33)
Offline
sry didnt work for me (i tried it)
Offline
terminator355 wrote:
sry didnt work for me (i tried it)
That's ok.
Offline