Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Tools for fulltext searching in Director and Authorware
Help Pad
Word Wrangler Xtra
Table
rgb Converter V1.0.1
cXtraShapeWindow
Wait for a MouseClick or Keypress
Get Line Number of Word
Installer
Set DirectToStage of a Animated Gif Sprite
MediaMacros Xtras Mall
 

 

 

Behavior 27 Sum Game-Numbers

Added on 5/1/2000

 

Compatibilities:
behavior D7 D8 Mac PC

Rating:

Author: DejanCicic

Three behaviors from game "27 Sum" library. 27 Sum Game is the game where you need to put odd numbers from 1 to 17 in 3x3 game fields and get sum of 27 in each row, column and diagonal. See a working example and source code in the learning arcade. The full game requires all 3 behaviors.Numbers, Fields, and Score Field.

property TargetSprite1 --First target sprite for the dragged sprite
property TargetSprite2 --Last target sprite for the dragged sprite
property startPos -- starting poition of the dragged sprite

property Mymember
on beginSprite me
  myMember=the member of sprite (the spritenum of me)
end

on mousedown me
  -- get start point of dragged sprite
  set startpos = the loc of sprite (the spritenum of me)
  
  -- move the sprite with the mouse
  repeat while the stilldown = true
    set the loc of sprite (the spritenum of me) = point(the mouseh, the mousev)
    updatestage
  end repeat
end

on mouseup me  
-- check to see if the MOUSE is inside the target sprite
  -- when released
  repeat with i=targetsprite1 to targetsprite2
    if inside(point(the mouseh, the mousev), the rect of sprite (i)) then
      sendValue me,i
      -- send the dragged sprite off screen
      set the loc of sprite the spritenum of me = point(1000,1000)
      exit repeat
      --end if
      
-- sets the dragged sprite back to starting position
    else
      set the loc of sprite (the spritenum of me) = startpos
      --exit repeat
    end if
  end repeat
end


on SendValue me, i
  myText=the name of member myMember
  myvalue=char 2 to (length(myText)) of myText
  sendSprite(i,#updateValue,myValue)
end






on getBehaviorDescription
  return "Creates sprites that can be dropped on any other [user specified] sprite. "
end

on getPropertyDescriptionList
  if voidp(TargetSprite1) then set TargetSprite1 = 1
  if voidp(TargetSprite2) then set TargetSprite2 = 1
  set p_list = [#TargetSprite1: [ #default:1,#format:#integer, #comment:"First Target Sprite Number", #range:[#min:1,#Max:120]], #TargetSprite2: [ #default:2,#format:#integer, #comment:"Second Target Sprite Number", #range:[#min:1,#Max:120]]]
  return p_list
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail