very good
It is better when the word appears, the timing begins, and not before the word appears in first time
Can you modify this please?
Printable View
very good
It is better when the word appears, the timing begins, and not before the word appears in first time
Can you modify this please?
For line 7 of the solitaire_play script you would just need to change the 1 second delay to 0 seconds.
Change 1000ms to 0ms
PHP Code:
var timeout_1=setTimeout(player_time,1000,turn);
Line 54 I commented this out as wellPHP Code:
var timeout_1=setTimeout(player_time,0,turn);
I will get to fixing the bugs when I get time later if you want to list them, because i'm sure that when 1 player didn't make a move you want to give the other player a score?PHP Code:
//_root.solitaire.solitaire_play.data_field.text="It is " + player_turn[turn] + " " + "turn."
download solitaire 11
Allow me to re-explain the game:
First press the red or black player button
Secondly, the word appears and the timing begins
Thirdly, Drag and drop the word card to the number card
Fourth, press the other player's button to start the same steps
I just added this function for the solitaire_play script called "released", it gets called when a card gets swiped to give the next user a turn with a timer.
This is the function inside the solitaire_play script, so when a red card gets swiped up the card has its internal function for release & calls _parent.released("red"); which is in the function inside the solitaire_play script:
When ticks reaches 40 in function pick for either card I commented out the timeout to give the next user a turn for red and black since the next turn will be given from a card swipe. :PHP Code:
function released(a){
if(a=="red"){
this.time_1=this.default_timeout//since it is the next players turn now we reset this.time_1 back to default which is 12 seconds.
this.timeout_1=setTimeout(this.player_time,1000,0);//timeout_1 stores the timeout so you can call clearTimeout if needed later.
_root.solitaire.solitaire_play.red_btn.enabled=false
_root.solitaire.solitaire_play.black_btn.enabled=true
}
if(a=="black"){
this.time_1=this.default_timeout//since it is the next players turn now we reset this.time_1 back to default which is 12 seconds.
this.timeout_1=setTimeout(this.player_time,1000,1);//timeout_1 stores the timeout so you can call clearTimeout if needed later.
_root.solitaire.solitaire_play.red_btn.enabled=true
_root.solitaire.solitaire_play.black_btn.enabled=false
}
}
PHP Code:
//this.timeout_1=setTimeout(this.player_time,1000,1);//timeout_1 stores the timeout so you can call clearTimeout if needed later.
For black0, black1, black2, black3 etc.. inside the release function for the card:
For red0, red1, red2, red3 etc.. inside the release function for the card:PHP Code:
_parent.released("black");
download solitaire 12PHP Code:
_parent.released("red");
can you disable drag after dropping the card
try drag the card again and look at timer ( problem )
Ok each card that had an internal release function with this call "_parent.released("red");" can have "this" as reference for the card
so in the solitaire_play script "b" = the card so we can do b.enabled = false to disable it.PHP Code:
_parent.released("red",this); //this is reference to the card in the released function thats in the solitiare_play script
b is "this", reference to the card and it gets disabled from this function
download solitaire 13PHP Code:
function released(a,b){
b.enabled=false
if(a=="red"){
this.time_1=this.default_timeout//since it is the next players turn now we reset this.time_1 back to default which is 12 seconds.
this.timeout_1=setTimeout(this.player_time,1000,0);//timeout_1 stores the timeout so you can call clearTimeout if needed later.
_root.solitaire.solitaire_play.red_btn.enabled=false
_root.solitaire.solitaire_play.black_btn.enabled=true
}
if(a=="black"){
this.time_1=this.default_timeout//since it is the next players turn now we reset this.time_1 back to default which is 12 seconds.
this.timeout_1=setTimeout(this.player_time,1000,1);//timeout_1 stores the timeout so you can call clearTimeout if needed later.
_root.solitaire.solitaire_play.red_btn.enabled=true
_root.solitaire.solitaire_play.black_btn.enabled=false
}
}
Can you edit after pressing the button the timing starts not after dropping the card
1.) Click to play.
2.) Time starts for random card.
3.) Card makes move.
4.) Card swipes up.
5.) Text tells the next person to go, no timer until next person clicks card.
Or did you expect :
1.) Click to play.
2.) Text tells the person to go, no timer until card gets clicked.
3.) Player clicks his card.
4.) Player swipes up.
5.) Text tells the next person to go, no timer until next person clicks card.
download solitiare 14
I left my job so I will be programming more lately but I need to make a batch of 3D Android games to sell.
1.) Click to play.
2.) Text tells the person to go, no timer until card gets clicked.
3.) Player clicks his button ( red or black ).
4.) Timing starts
5.) Player drag and drop his card. ( if timing end before drag and drop ==> the next player start and ready to click his button , no timer start until click button )
6.) Player swipes up.
7.) Text tells the next person to go, no timer until next person clicks card.
Ok I am pretty sure this covers what you asked.
For the timer to not start when it says "click to play game" on line 7 of solitaire play I just put null & commented out the timer that would start immediately:
So for line 10 that means we can just state who's turn it is to click a card by reading the textfield:PHP Code:
var timeout_1=null//setTimeout(player_time,0,turn);//on start setTimeout for function below which is a timer subtraction for the text field above the card game.
What I did when the timer runs out for a user that had to swipe up is to output:PHP Code:
if(turn==1){
_root.solitaire.solitaire_play.data_field.text="It is red cards turn."
}else{
_root.solitaire.solitaire_play.data_field.text="It is black cards turn."
}
On line 30 & 52 in solitaire_play script for both cards I also moved the card Mask back to -200 when the timer runs out while disabling the card from being swiped if the timer runs out:PHP Code:
_root.solitaire.solitaire_play.data_field.text="Black card didn't make a move on time, It is red cards turn."
In the same section I also commented out the new timer since the next player must first click the card before a timer appears:PHP Code:
for(var i=0;i<10;i++){
_root.solitaire.solitaire_play["black"+i].enabled=false
}
_root.solitaire.solitaire_play.Mask._x=-200
PHP Code:
//timeout_1=setTimeout(player_time,2500,turn);// lines 29 & 51 got commented out
download solitaire 15
Ok I fixed a bug where the card was being removed from the array too early.
When ticks==40 on line 185 & 212 I just stored 2 variables:
On each cards release function for swipe I added this function call:PHP Code:
_parent.ran=ran;//the splice numbers local variable stored as a global variable on line 5
_parent.col_num=0//the color number 0 or 1 stored as a global variable on line 6
On line 151 of solitaire_play this is the function that gets called from the card to remove an item from the card array:PHP Code:
_parent.removeCard(_parent.ran,_parent.col_num) //we call function _parent.removeCard & give it the 2 global variables _parent.ran is splice number to remove the card & _parent.col_num is the cards color to know which array to remove it from.
download solitaire 16PHP Code:
function removeCard(a,b){
if(b==0){
this.black_Mask.splice(a,1);
}else{
this.red_Mask.splice(a,1);
}
//_root.solitaire.solitaire_play._x=Number(red_Mask[a][1])
}
I fixed another issue where the card wasn't switching back to the pic attachment when a user doesn't make a move.
On the main script in solitaire_play the variables on line 6 & 7 I added 2 variables called last_card_text & last_card_text2:
In the script for each card that has an onFrame event for frame 2 I added _root.last_card_text=this;:PHP Code:
var last_card_text
var last_card_text2
PHP Code:
onFrame (2) {
_root.last_card_text=this;//black cards
stop();
}
On lines 29 & 54 I added this so the text can be hidden & the pic can be reattached:PHP Code:
onFrame (2) {
_root.last_card_text2=this;//red cards
stop();
}
PHP Code:
_root.last_card_text.gotoAndStop(1);
_root.last_card_text.pic.attachMovie("st1", "st1", 0)
That stuff is inside the player_time function from the solitaire_play script for when the timer runs out, to do that task.
download solitaire 17
If the user clicks its card turn repeatedly, the timer messes up so this solves that issue.
On line 186 & 187 the cards can be disabled on the first click:
Black card 2 had an issue when timing out because I put _parent. instead of _root..PHP Code:
_root.solitaire.solitaire_play.black_btn.enabled=false
_root.solitaire.solitaire_play.red_btn.enabled=false
black2 card:
download solitaire 18PHP Code:
onFrame (2) {
_root.last_card_text=this;
stop();
}
you are a great person