Be a Supporter!

Cheaters!

  • 272 Views
  • 8 Replies
New Topic Respond to this Topic
Loganmypwnmaster
Loganmypwnmaster
  • Member since: Sep. 17, 2006
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Cheaters! 2009-02-10 19:34:41 Reply

I have a maze game that I made from a tutorial, but if you click and hold the mouse you can go past all the obstacles so I am wondering how I would make it so that if the player holds the mouse button for 2+ seconds it sends them to a different frame.


TU MADRE!

EvanHayes
EvanHayes
  • Member since: Jan. 13, 2007
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Cheaters! 2009-02-10 19:41:47 Reply

why make it yourself and not copy and paste a tutorial. that way you wouldent have that problem :D
i guess your using onMouseMove and not onEnterFrame, fix that


Grah i feel so unknown, SK8MORE god damn :/ EvanHayes seems like a much more serious name than sk8more,so i changed it.

TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to Cheaters! 2009-02-10 19:41:49 Reply

well if you want it to go to a different frame when clicked, tell them it does that in the author's comments and put in something like,

onClipEvent(enterFrame)
{
if(Key.isDown(Key.SPACE)) {
goto.NewFrame (not sure how to do this bit. everything i do tends to be one frame!)
}
}

EvanHayes
EvanHayes
  • Member since: Jan. 13, 2007
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Cheaters! 2009-02-10 19:43:18 Reply

At 2/10/09 07:41 PM, TheSongSalad wrote: well if you want it to go to a different frame when clicked, tell them it does that in the author's comments and put in something like,

please read the whole post first......k?


Grah i feel so unknown, SK8MORE god damn :/ EvanHayes seems like a much more serious name than sk8more,so i changed it.

Loganmypwnmaster
Loganmypwnmaster
  • Member since: Sep. 17, 2006
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Cheaters! 2009-02-10 19:44:24 Reply

I want it to send them to a different frame if they are holding the mouse button for a few seconds


TU MADRE!

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Cheaters! 2009-02-10 19:45:27 Reply

At 2/10/09 07:34 PM, Loganmypwnmaster wrote: I have a maze game that I made from a tutorial, but if you click and hold the mouse you can go past all the obstacles so I am wondering how I would make it so that if the player holds the mouse button for 2+ seconds it sends them to a different frame.

You should code the game so that it will detect whether the mouse is held or not, by using onMouseDown and onMouseUp to set booleans (true or false). Then your enterFrame code should use this boolean when performing hitTests/collision detection.

If you really want to create such a timer, you're still going to have to trigger/stop it with onMouseDown/onMouseUp. The best bet on that would be to use setTimeout, which is documented in the Flash help or here (for AS2): AS: Timeout by Inglor


- - Flash - Music - Images - -

BBS Signature
EvanHayes
EvanHayes
  • Member since: Jan. 13, 2007
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Cheaters! 2009-02-10 19:52:20 Reply

At 2/10/09 07:44 PM, Loganmypwnmaster wrote: I want it to send them to a different frame if they are holding the mouse button for a few seconds

i understand that, do what denvish said, or you can avoid that problem completly by not using onMouseDown, no mouse avoider should do that. its easy enough to cheat but ive never seen that. but if you must know,ill put denvish's words into code

onMouseDown = function():Void{
// when the mouse is pushed down
nextFrameTimer = setInterval(function():Void{_root.gotoAndStop("gameOver")},1000)
// sets an interval to run a function every 1000 milliseconds--1 second--
// sets nextFrameTimer as a local variable to store the interval
}
onMouseUp=function():Void{
// when the left mouse button is up
clearInterval(nextFrameTimer)
// clears the past interval so it will not run
}

that makes it so when the mouse is down it sets a timer with setInterval to run every second, if that interval is running for 1 second it sends them to that gameover screen. when the mouse is up that interval is cleared.


Grah i feel so unknown, SK8MORE god damn :/ EvanHayes seems like a much more serious name than sk8more,so i changed it.

BillysProgrammer
BillysProgrammer
  • Member since: Sep. 17, 2008
  • Offline.
Forum Stats
Member
Level 16
Gamer
Response to Cheaters! 2009-02-10 20:15:44 Reply

At 2/10/09 07:41 PM, TheSongSalad wrote: well if you want it to go to a different frame when clicked, tell them it does that in the author's comments and put in something like,

onClipEvent(enterFrame)
{
if(Key.isDown(Key.SPACE)) {
goto.NewFrame (not sure how to do this bit. everything i do tends to be one frame!)
}
}

Well, if you're saying go to the next frame, using this

if(Key.isDown(Key.SPACE)) {
     nextFrame();
}

And if its for a specific frame

if(Key.isDown(Key.SPACE)) {
     gotoAndStop(#frame number);
}

This is just to show you, not really intended on the actual OP question.

TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to Cheaters! 2009-02-10 21:17:03 Reply

At 2/10/09 08:15 PM, BillysProgrammer wrote: This is just to show you, not really intended on the actual OP question.

thanks. useful to know.