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

#1 2010-04-03 16:00:39

Jcater
Scratcher
Registered: 2009-11-14
Posts: 13

what is the easiest way to code when no keys is pressed

HI i wonder if any of you out there would be able to help me

Bit of a problem as usual prob a simple one  tongue 

Im creating a game where the sprite stays still if no keys are pressed and a animation sequence if the right/left key is pressed however it does not seem to like this code
        // when right key not pressed then switch to static sprite



and the following code

       // if right key is pressed then switch to particular sprites

     
      // if left key is pressed then switch to particular sprites

Using the not(pressed Right) Or not(pressed Left) code doesnt seem to work

am I coding this wrong or is there a simpler method of doing this

I will upload what I have got so far asap and re-post the link





I appreicate any guidance or references

cheers  big_smile






(I'm making a scrolling platforming game similar to a game called plok for the super nintendo difference being the main character is a  cartoon skeleton boxer called Mike )

Offline

 

#2 2010-04-03 16:05:23

Jcater
Scratcher
Registered: 2009-11-14
Posts: 13

Re: what is the easiest way to code when no keys is pressed

http://scratch.mit.edu/projects/Jcater/966510

Offline

 

#3 2010-04-03 17:30:02

Ssbrawl700
Scratcher
Registered: 2009-02-11
Posts: 100+

Re: what is the easiest way to code when no keys is pressed

I found the problem and its pretty simple. According to the code once a key is press then Mike will change his costumes forever because the script to change his costume is in a forever block. Remove the forevers that contain the change costume scripts and you're done  smile


Can you beat the ever-so challenging Keyboard Khaos?

Offline

 

#4 2010-04-03 20:15:11

Jcater
Scratcher
Registered: 2009-11-14
Posts: 13

Re: what is the easiest way to code when no keys is pressed

aw cheers Ssbrawl that worked great
stupid logic I had in my head there thanks for helpful comment

Offline

 

Board footer