jason edwardes

Ranch Hand
+ Follow
since Oct 19, 2018
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
14
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jason edwardes


  the app will display a massage with a short delay between each word
In the shortDelay("it's",1000);  method
   change text ("its") to display another message and change the number (1000) to make the delay more or less




1 week ago

salvin francis wrote:Thats a lot of code and it would be a maintenance nightmare.

Here's my suggestion with comments to help you out:


Each SlotWinRule maintains its own "matches" method to see if it matches the current WheelData. It can also contain it's own points and type.




This looks great and I have spent some time last night and today seeing how far I can get,
really can't work out how to get the imageview current image after the Animation has stopped







1 month ago

salvin francis wrote:Technically it looks good, but I think you can take this further...
Your machine just allows user to earn 15 points or 4 points. that too based on rigid rules: All three match or just 2 matches.
I have played slot machines where it first asks you to place a bet over what you think would win. The user can place multiple bets including diagonal match, middle line, top line, etc.. There are also bets on zigzag patterns. Once the user has invested all his bets, he cranks up the slot machine.

There are slot machine variations with 4 wheels and 5 wheels too instead of 3.

User may win some bets and lose some... But no matter what, the house always wins



you would be surprised with my code, adding extra wheels is easy and some of the point system looks like this

points is a random number, at this point up to 85
adding wheels is as simple as adding an extra IndextNumber and as my wheels all show 3 items vertical on the wheel, adding diagonal match would be easy, the way I have build this app means there going to
be a lot of code but easy simple code and the same goes for the point system, low money in, high random number and as the money goes up the random number goes down till the odds of winning is very high, could even add things like 3x wins spin and use random number 7



     if (points == 1){leftIndextNumber =1; midleIndextNumber=1 ;rightIndextNumber =1;credit +=100; win = "Jackpot";}
       else if (points == 2){leftIndextNumber =2; midleIndextNumber=2 ;rightIndextNumber =2;credit += 50; win = "winner";}
       else if (points == 3){leftIndextNumber =3; midleIndextNumber=3 ;rightIndextNumber =3;credit +=40; win = "winner";}
       else if (points == 4){leftIndextNumber =4; midleIndextNumber=4 ;rightIndextNumber =4;credit +=40; win = "winner";}
       else if (points == 5){leftIndextNumber =5; midleIndextNumber=5 ;rightIndextNumber =5;credit +=40; win = "winner";}
       else if (points == 6){leftIndextNumber =6; midleIndextNumber=6 ;rightIndextNumber =6;credit +=40; win = "winner";}
       else if (points == 7){leftIndextNumber =7; midleIndextNumber=7 ;rightIndextNumber =7;credit +=30; win = "winner";}

1 month ago
Thank You everyone for the help

I have found most the answers I was looking for and would be happy to share them with anybody thinking about using some type of animation in there app.
The way I was trying to build the app was not the best way and I think it was going include lots of bugs and problems

so I started again and look at it from a different angle (animation-list) like an old rolling move clip I could use images to make the wheels






1 month ago

Daniel Demesmaecker wrote:And how is that different from my first post?



none your right Daniel
My phone email notification has been showing me questions on code-ranch, so clicked the link to answer this question, unfortunately the link did not include any answers that you have given
1 month ago

German Hernandez wrote:Hi guys im with my first java/android app

I want shuffle 5 images i already check on google "how to shuffle images java" and "how to shuffle a deck on java" and i read stackoverflow but they explain the logic for shuffle the values of cards  and i only want shuffle the images

If anyone can share a link or explainme what i need learn for add this effect will be great

thanks in advance for read this



Hi German Hernandez

1. random to get a number between 0 - 4
2. array of images
3. set the Imageview id

4.  set the imageview equal to the array[random number ]

You will get an random image



1 month ago
basic fruit machine, press a button and the 3 wheels give you a random image (cherry, seven, bar ect)
after a random time the first wheel stops, followed by the second and then the third

on line 74 (switch) I can set the current item value and display it in the textview

The problem is I need to pause a single method for 3 seconds and get the latest current item value
and store it in a variable to use in a point system

things like sleep,pause, not working for me,
they crash the app or makes the hole app sleep for a short time


3 months ago

The main two I can see is

Frames not available for unsuspended thread
Variables paused in another thread

this code runs fine but the current Index all way shows the default value before the threads have finished



// looking for a way to run the code after the threads have finished
3 months ago
Thanks for the help, I am having trouble trying to ask the right questions because I feel the code is getting complicated

so I have array of 6 images on 3 wheels to make up the fruit machine, click a button and after a random time in order, first wheel stops followed by the seconded wheel and the third wheel ( this part works great and I have good control and lots of options where I can change the speed, time min/max random spin time so it looks real)

the problem is after the wheels have stopped I try something like this and adding this code makes makes the app crash
just want a way to find the current index value after the thread has finished

 

3 months ago
Hi all

Still trying to work a few things out and help would be great, found some code and it works great in android so, here's the code I am finding difficult to understand
my goal is to stop the wheel spinning after 2-4 seconds without using on click





3 months ago
Thanks for the comments about the books, I will look these titles up on-line, I started off reading a book "Java for Dummies" to learn the basics about java, well the basics about most object-oriented programming language's
took a good 6 mouths to use and understand most of the things in the book and then I went over the basics again and followed the complete Beginner Java Programming Tutorials by TheNewBoston went over the course 3 times till i really understood objects in depth finished late 2016.

so then I started using net-bean Ide to build a few basic desktop app's till I found a free course on udacity  "nanodegrees android studio course", that was really interesting course in 2017 spent a year every night doing every thing i could to build apps even built a complete sandwich app for work with all the bells and whistles ( logs your details when you first use the app and with a few basic activity's, you make your own sandwich, bread, filling etc and then send then emails the order over to the sandwich line  )

very basic to use and built to the restaurants colours theme, they said they have a developer building a sandwich app for the restaurant so they can't use my app but another department asked me to build an app for them, it was a basic app and it took 2 weeks in my free time
worked very well and they said I was a very quick developer but most the apps they require are build in swift ( never used swift but have used kotlin a few times that was really good till I started trying to use threads lol, got a little stuck so went back to java for now )

since them ( 6 mouths back I have been following any android apps I can find on you tube and getting a higher understanding of java objects and android studio)

never had any real work experience but would like to be a programmer full time.
but just trying to find the best way to achieve this

thanks



3 months ago
sounds like good advice but the question was asked 4 mouths ago, not sure its going to help

but as we are on the subject of best way to get employed, I am 39 year old and have good understanding of building apps on android studio and understand the basics of Java.
what would be the best way to get employed as a junior programmer, UK Essex

would it be to spend 3 mouths learning Kotlin in depth or c# on visual studio (as the both similar to Java) or something else





3 months ago
Thanks for all your help but I think I will just use int from now on lol
3 months ago

Campbell Ritchie wrote:

jason edwardes wrote:. . . you can save a lot of space . . .

Are you really going to use a short instead of a long to save six bytes? Is it worth the trouble? Even on a mobile device?



didn't even know it would cause any trouble, I just know reducing code size, saves resources and should give you a improved results

but if using int is a stand way to program, that's what I will do from now on

3 months ago