var prizetemp:number = Math.round(Math.random() * (Number(winNums.length-1) - 0)) +



Similar documents
Mouse Programming Mouse Interrupts Useful Mouse functions Mouselib.h Mouselib.c

Scratch Primary Lesson 4

3. Add an Event: Alarm Alarm 0 a. Add an Action: Set Variable i. Applies to: Self ii. Variable: time_left iii. Value: +1 iv. Check the Relative box

App Inventor Tutorial 4 Cat & Mouse Game

Fruit Machine. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

Fish Chomp. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

TRIGONOMETRY FOR ANIMATION

Interaction: Mouse and Keyboard DECO1012

WAYNESBORO AREA SCHOOL DISTRICT CURRICULUM INTRODUCTION TO COMPUTER SCIENCE (June 2014)

1.0-Scratch Interface 1.1. Valuable Information

Whack-a-Witch. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

Activities for LEGO WeDo in Scratch 1.4+ Barb Ericson

Game Programming & Game Design

REFERENCE GUIDE 1. INTRODUCTION

PRI-(BASIC2) Preliminary Reference Information Mod date 3. Jun. 2015

Use fireworks and Bonfire night as a stimulus for programming

4D v11 SQL Release 1 (11.1) ADDENDUM

Write Your Angry Bird Game on Tizen for Fun and Profit. Lu Guanqun Intel Corporation

Teaching Non-majors Computer Programming Using Games as Context and Flash ActionScript 3.0 as the Development Tools

Getting Started with Scratch

How to Build a Simple Pac-Man Game

Java case studies: game playing. development

EMSCRIPTEN - COMPILING LLVM BITCODE TO JAVASCRIPT (?!)

I Have...Who Has... Multiplication Game

How to Run a Scratch Competition

TouchDevelop Curriculum

07/04/2014 NOBIL API. Version 3.0. Skåland Webservice Side 1 / 16

Computer Science Education Week Teacher/Volunteer Guide

BallBounce: A simple game app

Make your own Temple Run game

USB Human Interface Joystick Demonstration Create a HID USB Device (sample Joystick) By Jared St.Clare, October 2009 Version 1

4D v11 SQL Release 3 (11.3) ADDENDUM

Computer Science Concepts in Scratch

Debugging JavaScript and CSS Using Firebug. Harman Goei CSCI 571 1/27/13

SCRATCH PROGRAMMING AND NUMERACY IN SENIOR PRIMARY CLASSES

The Richard Pate School. Draft Year 4 Scheme of Work for Scratch

Qualtrics Question API

Time Matters Document Management System (DMS)

Computer Systems Technology Pathway

KS3 Computing Group 1 Programme of Study hours per week

How To Use Webmail. Guiding you through the Universities online

Creating Animated Apps

MADISON PUBLIC SCHOOL DISTRICT. Grade 8 Cycle Class. Scratch

Yandex.Widgets Quick start

Mobile App Development Using App Inventor

Click Here -> El poder de la Programación de Excel y Visual Basic - Scam or Work?

Great Basin College Spring Semester GRC 188 section 1001 Web Animation and Interactivity I

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

A BRIEF INTRODUCTION TO COMPUTER PROGRAMMING Scratch, LEGO MINDSTORMS, and Visual Basic. July 24, 2015

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

Installing and Sending with DocuSign for NetSuite v2.2

Client-Server Creation of Complex PDF Documents

Course Syllabus. GAME 1403 Introduction to Game Design and Development

iportal2 Mouse Mover Quick Start Guide GBK52984 V1.0

I don t intend to cover Python installation, please visit the Python web site for details.

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

Numbers Game. Sort Set in Order Shine Standardize Sustain.

Integration Guide. Integrating Extole with Salesforce. Overview. Use Cases

1. Get to know the SCRATCH Work Space:

Mother s Day, Warrior Cats, and Digital Fluency: Stories from the Scratch Online Community

Interactive HTML Reporting Using D3 Naushad Pasha Puliyambalath Ph.D., Nationwide Insurance, Columbus, OH

App and Game Development with Corona SDK

What You ll Build. CHAPTER 3 MoleMash

Multimedia im Netz Online Multimedia Winter semester 2015/16. Tutorial 03 Major Subject

Storage and Playback Getting Started Guide

Titanium Alloy Tutorial

Copyright 2006 TechSmith Corporation. All Rights Reserved.

Using Safari to Deliver and Debug a Responsive Web Design

CHAPTER 14 Understanding an App s Architecture

COURSE GOALS AND OBJECTIVES

Boogie: A Modular Reusable Verifier for Object-Oriented Programs

SCRATCH Lesson Plan What is SCRATCH? Why SCRATCH?

So You Want to Learn to Program?

NO SQL! NO INJECTION?

Creating a Database in Access

Outline. 1.! Development Platforms for Multimedia Programming!

PROJECT ON MICROSOFT ACCESS (HOME TAB AND EXTERNAL DATA TAB) SUBMITTED BY: SUBMITTED TO: NAME: ROLL NO: REGN NO: BATCH:

Creating a new project up to a working PES

BallBounce: A simple game app

MWR InfoSecurity Advisory. Interwoven Worksite ActiveX Control Remote Code Execution. 10 th March Contents

THE WHIM WINDOW MANAGER

Year 8 KS3 Computer Science Homework Booklet

Transcription:

Scratch Card Game Source Code (fahimchowdhury.com) stop(); import flash.utils.timer; import flash.events.timerevent; var mytimer:timer = new Timer(3000,1); mytimer.addeventlistener(timerevent.timer, goto); var mouseclick:number=0; var scratchcount:array = new Array(); var winnums:array = new Array(" 100"," 50"," 20"," 1"); var scratchedarray:array = new Array(); for(var a=1; a < 10; a++) 0; var prizetemp:number = Math.round(Math.random() * (Number(winNums.length-1) - 0)) + //trace(winnums[prizetemp]); MovieClip(this.getChildByName("box"+a+"_mc")).txt.text=winNums[prizeTemp]; var hand1_mc:hand_mc = new hand_mc(); var currentbox:string=""; addchild(hand1_mc); Mouse.hide(); stage.addeventlistener(mouseevent.mouse_move,follow); function follow(evt:mouseevent) hand1_mc.x = mousex; hand1_mc.y = mousey; //2. var mask_mc:sprite = new Sprite();

var mask2_mc:sprite = new Sprite(); var mask3_mc:sprite = new Sprite(); var mask4_mc:sprite = new Sprite(); var mask5_mc:sprite = new Sprite(); var mask6_mc:sprite = new Sprite(); var mask7_mc:sprite = new Sprite(); var mask8_mc:sprite = new Sprite(); var mask9_mc:sprite = new Sprite(); box1_mc.mask = mask_mc; box2_mc.mask = mask2_mc; box3_mc.mask = mask3_mc; box4_mc.mask = mask4_mc; box5_mc.mask = mask5_mc; box6_mc.mask = mask6_mc; box7_mc.mask = mask7_mc; box8_mc.mask = mask8_mc; box9_mc.mask = mask9_mc; addchild(mask_mc); addchild(mask2_mc); addchild(mask3_mc); addchild(mask4_mc); addchild(mask5_mc); addchild(mask6_mc); addchild(mask7_mc); addchild(mask8_mc);

addchild(mask9_mc); //3. stage.addeventlistener(mouseevent.mouse_down, moused); stage.addeventlistener(mouseevent.mouse_move, mousem); stage.addeventlistener(mouseevent.mouse_up, mouseu); reveal1_mc.addeventlistener(mouseevent.mouse_over, active); reveal2_mc.addeventlistener(mouseevent.mouse_over, active); reveal3_mc.addeventlistener(mouseevent.mouse_over, active); reveal4_mc.addeventlistener(mouseevent.mouse_over, active); reveal5_mc.addeventlistener(mouseevent.mouse_over, active); reveal6_mc.addeventlistener(mouseevent.mouse_over, active); reveal7_mc.addeventlistener(mouseevent.mouse_over, active); reveal8_mc.addeventlistener(mouseevent.mouse_over, active); reveal9_mc.addeventlistener(mouseevent.mouse_over, active); //4. function moused(event:mouseevent):void mouseclick = 1; //5. function mousem(e:mouseevent):void if (currentbox == "reveal1_mc" && mouseclick==1) scratchedarray.push(box1_mc.txt.text);

mask_mc.graphics.beginfill(0x000000); mask_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask_mc.graphics.endfill(); if (currentbox == "reveal2_mc" && mouseclick==1) scratchedarray.push(box2_mc.txt.text); mask2_mc.graphics.beginfill(0x000000); mask2_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask2_mc.graphics.endfill(); if (currentbox == "reveal3_mc" && mouseclick==1) scratchedarray.push(box3_mc.txt.text); mask3_mc.graphics.beginfill(0x000000); mask3_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask3_mc.graphics.endfill();

//// if (currentbox == "reveal4_mc" && mouseclick==1) scratchedarray.push(box4_mc.txt.text); mask4_mc.graphics.beginfill(0x000000); mask4_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask4_mc.graphics.endfill(); if (currentbox == "reveal5_mc" && mouseclick==1) scratchedarray.push(box5_mc.txt.text); mask5_mc.graphics.beginfill(0x000000); mask5_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask5_mc.graphics.endfill(); if (currentbox == "reveal6_mc" && mouseclick==1)

scratchedarray.push(box6_mc.txt.text); mask6_mc.graphics.beginfill(0x000000); mask6_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask6_mc.graphics.endfill(); ///// /// if (currentbox == "reveal7_mc" && mouseclick==1) scratchedarray.push(box7_mc.txt.text); mask7_mc.graphics.beginfill(0x000000); mask7_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask7_mc.graphics.endfill(); if (currentbox == "reveal8_mc" && mouseclick==1) scratchedarray.push(box8_mc.txt.text);

mask8_mc.graphics.beginfill(0x000000); mask8_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask8_mc.graphics.endfill(); if (currentbox == "reveal9_mc" && mouseclick==1) scratchedarray.push(box9_mc.txt.text); mask9_mc.graphics.beginfill(0x000000); mask9_mc.graphics.drawellipse(mousex, mousey, 3, 3); mask9_mc.graphics.endfill(); //6. function mouseu(event:mouseevent):void mouseclick = 0; if(scratchcount.length >= 3) mytimer.start();

function active(e:mouseevent) currentbox =e.currenttarget.name; //trace(scratchcount); function goto(e:timerevent) stage.removeeventlistener(mouseevent.mouse_move,follow); this.removechild(hand1_mc); Mouse.show(); if(scratchedarray[0] == scratchedarray[1] && scratchedarray[0] == scratchedarray[2]) this.gotoandstop(this.currentframe+1); txt.text=scratchedarray[0]; play_btn.addeventlistener(mouseevent.click,startagain); else this.gotoandstop(this.currentframe+2); play_btn.addeventlistener(mouseevent.click,startagain); function startagain(e:mouseevent) this.gotoandplay(1);