Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: collision victim, detection challanged
From: Larry Eisenstein (E-mail)
Date: Sun, 23 Jan 2000 00:52:10 GMT

Hi all,
First I salute all those brave enough to view my retched
attempt to write a little game. I realize I have violated
irrepairably the virginal actionscript pop-up window of my
goddess Flash 4. I realized she was underage...I have no
excuse. May the programming gods strike me down
quickly and mercifully.

I want to know how to tell 2 MC's (which I am moving
right and left with key presses) to go to specific x position
when they exceeds the left and right x position maximums I have set
with my variables.

When I initiate movement with keypresses, the MC blows right by
the limits I've set using the If statements.
Is it something about keypresses? I get better results without
the keypresses but I need em for the game.

Set Variable: "Guy1xpos" = GetProperty ("/Guy1", _x )
Set Variable: "Guy2xpos" = GetProperty ("/Guy2", _x )
Set Variable: "leftmax" = 0
Set Variable: "rightmax" = 700
Set Variable: "Guy2xpos_Leftmax" = leftmax - 140
Set Variable: "Guy2xpos_Rightmax" = rightmax - 280
Set Variable: "Guy1xpos_Lefttmax" = leftmax + 140
Set Variable: "Guy1xpos_Rightmax" = righttmax - 140
If (Guy2xpos <= Guy2xpos_Leftmax)
Set Property ("/Guy2", X Position) = Guy2xpos_Leftmax
End If
If (Guy2xpos >= Guy2xpos_Rightmax)
Set Property ("/Guy2", X Position) = Guy1xpos_Rightmax
End If
If (Guy1xpos <= Guy2xpos_Leftmax)
Set Property ("/Guy1", X Position) = Guy2xpos_Leftmax
End If
If (Guy1xpos >= Guy2xpos_Rightmax)
Set Property ("/Guy1", X Position) = Guy2xpos_Rightmax
End If

Any takers?
Thanks,
Larry

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: collision victim, detection , Branden Hall

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]