This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-04-12 14:55:18

Imaginos
New Scratcher
Registered: 2013-03-06
Posts: 56

Button sensitivity

I don't want to give too much away about the game project that I am currently working on so I won't publish my work-in-progress until I have got it more developed but I was wondering if any of you good people could help me out.

The problem I have is this... my main sprite has 8 compass points that it can point in and I am using the keys "z" & "x" to rotate my character clockwise or anti-clockwise. Is there any way that I can make these keys less sensitive without slowing the whole game down?

Offline

 

#2 2013-04-12 15:11:57

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: Button sensitivity

Put the turning scipt separate to the rest and put if key x pressed, turn right, wait 0.1 seconds, end, if key z pressed e.t.c. or put wait until not key x pressed if you want it to turn one bit per press.  smile

Offline

 

#3 2013-04-12 15:36:47

jmht
New Scratcher
Registered: 2012-11-21
Posts: 1

Re: Button sensitivity

Instead of turning clockwise or anticlockwise by 1, change the value to 0.5 or something less? That way, per frame it will rotate less.  smile

Offline

 

#4 2013-04-12 16:00:01

Imaginos
New Scratcher
Registered: 2013-03-06
Posts: 56

Re: Button sensitivity

jmht wrote:

Instead of turning clockwise or anticlockwise by 1, change the value to 0.5 or something less? That way, per frame it will rotate less.  smile

Thanks for the suggestion jmht but I'm not actually rotating my sprite... I have 8 different costumes for my sprite depending on which of the 8 possible directions it is pointing to.

Offline

 

#5 2013-04-12 18:19:44

dusty22
Scratcher
Registered: 2012-09-28
Posts: 49

Re: Button sensitivity

Using a Forever If [Key Pressed] statement is more responsive than using a When [Key Pressed] statement also.

Offline

 

#6 2013-04-12 18:35:45

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: Button sensitivity

So it changes costumes, the scratchblocks are like this:

when gf clicked
forever
 if <key [z v] pressed?>
  next costume
  wait until <not<key [z v] pressed?>>
 end
 if <key [x v] pressed?>
  switch to costume ((costume #) - (1))
  wait until <not<key [x v] pressed?>> 
 end


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

#7 2013-04-13 05:10:23

Imaginos
New Scratcher
Registered: 2013-03-06
Posts: 56

Re: Button sensitivity

7734f wrote:

So it changes costumes, the scratchblocks are like this:

when gf clicked
forever
 if <key [z v] pressed?>
  next costume
  wait until <not<key [z v] pressed?>>
 end
 if <key [x v] pressed?>
  switch to costume ((costume #) - (1))
  wait until <not<key [x v] pressed?>> 
 end

Thanks 7734f. That worked perfectly. I hope to get the project published on the forum shortly.

Offline

 

Board footer