Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

explain hangman game lingo

Posted on 2005-04-21
2
Medium Priority
?
458 Views
Last Modified: 2013-12-24
This lingo is for a hangman game, there are 6 stages of hanging each has its own image. A text file holding the words and the letters a-z. Can anyone explain thanks. i'm goin to post this question twice as i feel its worth more than 500 points.

"lingo below added to the letters"


property myLetter, spriteNum, used

global gHangmanWord

on beginSprite me
  used = 0
  myLetter = sprite(spriteNum).member.name.char[1]
end

on mouseEnter me
  if used = 0 then
    sprite(spriteNum).member = member(myLetter & "-red")
  end if
end

on mouseLeave me
  if used = 0 then
    sprite(spriteNum).member = member(myLetter & "-nor")
  else
    sprite(spriteNum).member = member(myLetter & "-used")
  end if
end

on mouseUp me
  if used = 0 then
    used = true
    if gHangmanWord contains myLetter then      
      sendAllSprites(#showLetter, myLetter)
      returnList = []
      sendAllSprites(#checkWin, returnList)
      if returnList.getOne(0) = 0 then
        go "hangmanwin"
      end if
     
    else
      sendAllSprites(#hangMe)
      sendAllSprites(#checkLoss)
    end if
    sprite(spriteNum).member = member(myLetter & "-used")
  end if
end


"code added to the image of the hanging base"


property spriteNum, hangWrong

global gHangmanWord

on hangMe me
  hangWrong = hangWrong + 1
  sprite(spriteNum).member = "JAY" & hangWrong
end

on beginSprite me
  hangWrong = 0
  sprite(spriteNum).member = "JAY" & hangWrong
end

on checkLoss me
  if hangWrong >= 6 then
    sendAllSprites(#showLoss)
    go "hangmanLoss"
  end if  
end


"added to dots that represent the number of letters"

property spriteNum, myLetter, showing

on showLetter me, whatLetter
  if myLetter = whatLetter then
    showing = true
    sprite(spriteNum).member = member(myLetter)
  end if
end

on checkWin me, winList
  winList.add(showing)
end

on assignLetter me, letterList
  sprite(spriteNum).member = member("dash")
  if letterList.count > 0 then
    myLetter = letterList[1]
    deleteAt(letterList, 1)
    showing = 0
    sprite(spriteNum).blend = 100
  else
    showing = 1
    myLetter = "empty"
    sprite(spriteNum).member = member("empty")
  end if
end

on beginSprite me
  sprite(spriteNum).blend = 0
end

on showLoss me
  sprite(spriteNum).member = member(myLetter)
end



"added to lingo script channel"


global gHangmanWord

on exitFrame me
  gHangmanWord = getHangmanWord()
  letterList = []
  repeat with x = 1 to gHangmanWord.char.count
    letterList.add(gHangmanWord.char[x])
  end repeat
  sendAllSprites(#assignLetter, letterList)    
end

on getHangmanWord
  pickText = member("hangmanWords").text
  howManyLines = pickText.line.count
  repeat with x = howManyLines down to 1
    if pickText.line[x] = "" then delete pickText.line[x]
  end repeat
  thisOne = random(howManyLines)
  return pickText.line[thisOne]
end
0
Comment
Question by:lukegriffiths110
1 Comment
 
LVL 5

Accepted Solution

by:
LingoMaster earned 80 total points
ID: 13839719
Again if you can explain your situation, are you looking at the code for pure acadamic purposes, or just have a pragmatic need to get the game code working. ( I trust we're not just doing someone's homework)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question