image movement

murray83

Games Collector
Local time
Today, 05:59
Joined
Mar 31, 2017
Messages
828
can someone tell me whether the following is possible.

trying to make an image move to different positions in the form based on criteria in a dlookup

see two attached images for what i would like or am i being to ambitious and foolhardy
 

Attachments

  • player start.png
    player start.png
    3.4 KB · Views: 95
  • player after roll.png
    player after roll.png
    37.8 KB · Views: 90
I would have thought you would just set left and top coordinates?
 
Should be possible. In your table I would store all off my label names with the positions (top and left). So if moving to fleet street you can use your dlookup to return that labels name and the location to move your image.
 
in my table the textboxes are all numbered 0 to 39

as can see in attached work so far
 

Attachments

you could give your labels names that match their order with some calculations to determine side.
e.g.

Go=lbl00
OldKentRoad=lbl01
Pentonville=lbl09
Jail=lbl10
Mayfair=lbl39
etc

to start
player1 uses token1
player1PreviousValue=0

provide some offsets so tokens don't cover each other
token1Offset=1000
token2Offset=500
etc

player1 rolls the dice
dicevalue=dice1+dice2 (e.g.3+5)=8
token1.left=me("lbl" & format(player1previousvalue+dicevalue mod 40,"00").left+token1offset
token1.top=me("lbl" & format(player1previousvalue+dicevalue mod 40,"00").top+token1offset
player1previousvalue=player1previousvalue+dicevalue mod 40
 
Simple Example
 

Attachments

You might find this example useful as well Reaction Timer.
Code is used to move an object to random positions on a form
 

Users who are viewing this thread

Back
Top Bottom