Wireless Technology Practical Journal
Wireless Technology Practical Journal
PCP CENTER:
Certificate
Examiner
University of Mumbai
INDEX
Subject: _Wireless Technology & Mobile Computing
Code:
Label1
Text_input1
Button1
Button2
Button3
Image1
Text_input3
Text_input2
Text_input4
Text_input5
Button4
Label2
Image2
Text_input7
Text_input6
Text_input8
Text_input9
Image3 Image4
Practical 2:-
Code:-
/*
WHAT DO YOU THINK THE CONDITION WOULD BE IF YOU WANT THE TREX TO
CONTINUE TO LIVE.
*/
/*
WHAT DO YOU THINK THE CONDITION WOULD BE IF YOU WANT THE TREX TO
CONTINUE TO LIVE.
THEN _____
Keep Running.
Stop.
Jump.
Do Nothing.
*/
// Extra Pruning
condition = condition.trim().toLowerCase();
then = then.trim().toLowerCase();
//set text
textSize(18);
textFont("Georgia");
textStyle(BOLD);
//score
var count = 0;
function draw() {
//set background to white
background("white");
//display score
text("Score: "+ count, 250, 100);
//add gravity
trex.velocityY = trex.velocityY + 0.8;
//spawn obstacles
spawnObstacles();
//set lifetime of the game objects so that they are never destroyed
ObstaclesGroup.setLifetimeEach(-1);
CloudsGroup.setLifetimeEach(-1);
gameOver.setAnimation("gameOver");
gameOver.scale = 0.5;
restart.setAnimation("restart");
restart.scale = 0.5;
}
drawSprites();
}
function spawnObstacles() {
if(World.frameCount % 60 === 0) {
var obstacle = createSprite(400,365,10,40);
obstacle.velocityX = - (6 + 3*count/100);
//generate random obstacles
var rand = randomNumber(1,6);
obstacle.setAnimation("obstacle" + rand);
function spawnClouds() {
//write code here to spawn the clouds
if (World.frameCount % 60 === 0) {
var cloud = createSprite(400,320,40,10);
cloud.y = randomNumber(280,320);
cloud.setAnimation("cloud");
cloud.scale = 0.5;
cloud.velocityX = -3;
Output:-
Practical :- 3
Code:-
onEvent("button5","click",function(){
setScreen("screen1")
});
Output:-
Practical:- 4
Code:
createRecord("Users", {Email:(getText("email")),Password:(getText("password")),Photo:
(getImageURL("photo"))},
function(record)
});
playSound("sound://default.mp3", false);
setScreen("screen3");
});
var user=[];
{
if(records[i].Email!=getText("email"))
appendItem(user, records[i].Email);
setText("useremail",records[i].Email);
setImageURL("userimage", records[i].Photo);
setProperty("dropdown1","options", user);
playSound("sound://default.mp3", false);
});
setScreen("screen2");
});
var user1=[];
if(records[i].Email!=getText("email"))
appendItem(user1, records[i].Email);
}
setProperty("dropdown1","options", user1);
playSound("sound://category_bell/hollow_bell_notification.mp3", false);
});
});
createRecord(getText("useremail")+getText("dropdown1"),
{Sender:getText("useremail"), Receiver:getText("dropdown1"),
Message:getText("messagebox")}, function (record){
});
setText("messagebox"," ");
});
readRecords(getText("dropdown1")+getText("useremail"),{}, function(records){
});
});
Output:-
Practical :- 5
Code:-
setScreen("screen2");
hideElement("label1");
});
if (getText("text_input1") == "eduler11") {
setScreen("screen3");
} else {
showElement("label1");
});
Output:-
Practical:- 6
Code:-
var score = 0;
onEvent("button_start", "click", function( ) {
setScreen("quiz");
});
onEvent("dropdown1", "change", function( ) {
setScreen("quiz");
});
onEvent("radio_cat", "click", function( ) {
showElement("button_next1");
});
onEvent("radio_dog", "click", function( ) {
showElement("button_next1");
});
onEvent("button_next1", "click", function( ) {
setScreen("quiz2");
});
onEvent("radio_pushups", "click", function( ) {
showElement("button_next2");
});
onEvent("radio_jumping_jacks", "click", function( ) {
showElement("button_next2");
});
onEvent("button_next2", "click", function( ) {
setScreen("quiz3");
});
onEvent("button_true", "click", function( ) {
showElement("button_next3");
score = score;
});
onEvent("button_false", "click", function( ) {
score = score + 1;
showElement("button_next3");
});
onEvent("button_next3", "click", function( ) {
setScreen("quiz4");
});
onEvent("button_true2", "click", function( ) {
score = score + 1;
showElement("button_next4");
});
onEvent("button_false2", "click", function( ) {
score = score;
showElement("button_next4");
});
onEvent("button_next4", "click", function( ) {
setScreen("screen_result");
setText("labelscore", score);
});
Output: