Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / if logic with flashing and steadied image?

Author
Message
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Jul 2010 23:36 Edited at: 25th Jul 2010 23:44
Could someone post a way of making an object flash between to images [on - off] at a steadied rate but also when you click on the object it stay on your third image [locked].

can get the flashing on and off working but what ever way I try to get the third image to say I've picked it.

to get the ideal quicker I trying to make the hold button on a fruit machine where the button flashes on and off until you press it then it stays on. [stays on is to be the third image.]

edit
forgot to say has to work with six object where anyone or all could be flashing to start, then locked on if picked.

Dark Physics makes any hot drink go cold.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Jul 2010 00:15
Make a state variable associated with a sprite. State=0 means flash, 1=clicked so third image. You will also have to make a sprite mouse if you are wanting to do sprite collision. If it's not complicated, you could just use a coordinate system for that.....

This should get you started.

The fastest code is the code never written.
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 26th Jul 2010 00:29
Cheers Hawkblood, been long day for me, so what you've posted could be it but my brain gone out to lunch, so what the eyes see the brain does not get.

May be after a nights sleep, it will a lot clearer on how to use the above.

almost had it going with my own code but would only work when I clicked the last image to check, plus I had done as you said and had a state checker, that was show true false but the code check did not see it.

so I'm off to bed will read your reply in the mornning if you post one, also looking for any other ways that might be out there.

Dark Physics makes any hot drink go cold.
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Jul 2010 01:39
so this does not end up with a dead end post where that's the question I ask, but where the answer, here's a bit of the code I came up with.

you may need to add 6 objects, start at 10 up to 15 and three images
to get the code to at least run.

might post a working example later.



Dark Physics makes any hot drink go cold.
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Jul 2010 14:01 Edited at: 27th Jul 2010 16:30
ok here the code showing how to make and object change testures form 1 to 2 and back to 1 but if clicked on it stays on 3.

run and see



Dark Physics makes any hot drink go cold.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Jul 2010 16:23

Are you only using one? What's the "h" for?

It looks like it works from reading the code (can't test it with this pc).

The fastest code is the code never written.
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Jul 2010 16:29
opps will correct the code take the h out was for when I was checking 6 objects in for next loop, it only worked because h was zero above.

Dark Physics makes any hot drink go cold.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Jul 2010 16:30
Why don't you make multiple objects in a for-next and try it.

The fastest code is the code never written.
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Jul 2010 16:38
hawkblood have got code going now if you look at what I have in the dice challenge you'll see it going.

plus posted a working copy in code snippets.

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2026-07-25 05:32:50
Your offset time is: 2026-07-25 05:32:50