ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby Silvio.Falconi » Tue Sep 12, 2017 8:09 pm

just an Idea

I thinke you must create an array with 36 numbers of roulette and add also the zero

aNumbers:=:= { 0,32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10,5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26}

control if I insert all numbers


Msginfo( aNumbers[ Int(nDegrees/36)])

I tried but not run ok
I not understood because each times the number is on different position

Code: Select all  Expand view  RUN
function Spin( oImage )

   local nStep       := 5
   local n
   local nDegrees
   Local aNumbers:= { 0,32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10,5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26}

   for n := 1 to 1000 / nStep
      oImage:Rotate( nStep )
      SysWait( 0.005 * nStep )
   next

   nDegrees := oImage:nRotate % 360
     Msginfo( aNumbers[ Int(nDegrees/36)])
    * Msginfo( nDegrees)

return nil


any solution ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby ukoenig » Sat Sep 16, 2017 1:17 pm

Silvio,

YES,
because the numbers of the wheel are mixed
You can define a array with the numbers

LOCAL aValue[37]

starts from 36 to 6 ( top first step )
each step = 10 degrees

aValue[1] := 6 // first step
aValue[2] := 27
aValue[3] := 13
aValue[4] := 36
aValue[5] := 11
aValue[6] := 30
aValue[7] := 8
aValue[8] := 23
aValue[9] := 10
aValue[10] := 5
aValue[11] := 24
aValue[12] := 16
aValue[13] := 33
aValue[14] := 1
aValue[15] := 20
aValue[16] := 14
aValue[17] := 31
aValue[18] := 9
aValue[19] := 22
aValue[20] := 18
aValue[21] := 29
aValue[22] := 7
aValue[23] := 28
aValue[24] := 12
aValue[25] := 35
aValue[26] := 3
aValue[27] := 26

aValue[28] := 0 // left position

aValue[29] := 32
aValue[30] := 15
aValue[31] := 19
aValue[32] := 4
aValue[33] := 21
aValue[34] := 2
aValue[35] := 25
aValue[36] := 17 // last step of 36 * 10 = 360 degrees
aValue[37] := 34 // reaching the top

The number of the array is the same like the
position of the wheel ( steps are 10 degrees each number ).

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby cnavarro » Sat Sep 16, 2017 10:37 pm

Try

Code: Select all  Expand view  RUN


#include "fivewin.ch"

Static nHora   := 0
Static nOldH   := 0
Static nImgs   := 12
//----------------------------------------------------------------------------//

function Main()

   local cImage, oImage
   local oDlg

   cImage   := "c:\fwh\bitmaps\alphabmp\flight.bmp"  // your image file

   DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL

   @ 20, 20 XIMAGE oImage SOURCE cImage SIZE 256,256 OF oDlg

   @ 20,300 BTNBMP PROMPT "Spin" SIZE 160,40 PIXEL OF oDlg FLAT ;
      ACTION Spin( oImage )

   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------------------------//

function Spin( oImage )

   local nStep     := 5
   local n
   local nR        := nRandom( nImgs - 1 ) + 1
   nOldH           := nHora
   for n := 1 to 360
      oImage:Rotate( nStep * nR )
      SysWait( 0.008 )
      nR           := nRandom( nImgs - 1 ) + 1
   next
   ? ( nHora += 12 - Int( Mod( oImage:nRotate, 360 ) / ( 360 / nImgs ) ) - nOldH )
return nil

//----------------------------------------------------------------------------//


 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby Silvio.Falconi » Tue Sep 26, 2017 1:49 pm

Cristobal. Output your function the number is not on the same position

please I set the position arrow at left see the picture

Image

How we can use a ball ( game.prg) to animate it on route and stop it on the number ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby Silvio.Falconi » Tue Sep 26, 2017 1:54 pm

ukoenig wrote:Silvio,

YES,
because the numbers of the wheel are mixed
You can define a array with the numbers

LOCAL aValue[37]

starts from 36 to 6 ( top first step )
each step = 10 degrees

aValue[1] := 6 // first step
aValue[2] := 27
aValue[3] := 13
aValue[4] := 36
aValue[5] := 11
aValue[6] := 30
aValue[7] := 8
aValue[8] := 23
aValue[9] := 10
aValue[10] := 5
aValue[11] := 24
aValue[12] := 16
aValue[13] := 33
aValue[14] := 1
aValue[15] := 20
aValue[16] := 14
aValue[17] := 31
aValue[18] := 9
aValue[19] := 22
aValue[20] := 18
aValue[21] := 29
aValue[22] := 7
aValue[23] := 28
aValue[24] := 12
aValue[25] := 35
aValue[26] := 3
aValue[27] := 26

aValue[28] := 0 // left position

aValue[29] := 32
aValue[30] := 15
aValue[31] := 19
aValue[32] := 4
aValue[33] := 21
aValue[34] := 2
aValue[35] := 25
aValue[36] := 17 // last step of 36 * 10 = 360 degrees
aValue[37] := 34 // reaching the top

The number of the array is the same like the
position of the wheel ( steps are 10 degrees each number ).

regards
Uwe :?:



wich is your function to calculate the number ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby cnavarro » Tue Sep 26, 2017 3:26 pm

Silvio.Falconi wrote:Cristobal. Output your function the number is not on the same position

please I set the position arrow at left see the picture

How we can use a ball ( game.prg) to animate it on route and stop it on the number ?


Silvio, you are changed this ?

Code: Select all  Expand view  RUN

Static nImgs   := 37
 


Send me your image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: ROULETTE OF THE FORTUNE - ROTATE ROUND PICTURE

Postby Silvio.Falconi » Tue Sep 26, 2017 3:40 pm

yes not run
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests