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 Discussion / i don't know how to make the image appear at random

Author
Message
Mico
21
Years of Service
User Offline
Joined: 7th Dec 2003
Location:
Posted: 7th Dec 2003 18:26
I am writing my first game and need help.
In the game images pop up at in building windows and they ahve to be shot.
my problem is that i have got the building in and can paste the image on top of 1 window but i don't know how to make the image appear at random windows and make it a random picture that pops up. i also can't get the image to disappear after it has been shot orindeed after a certain time has elapsed.

any help would be much appreciated.

i thank you for any help given
mico
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 7th Dec 2003 19:02
Pseudo untested code...should be about right



RPGamer


Dont forget to Join the Forums!
Mico
21
Years of Service
User Offline
Joined: 7th Dec 2003
Location:
Posted: 7th Dec 2003 19:19
thnx mate soory bout the double post but i can't get this to work
cheers any way looks like am gonna have to oldier on
Mico
21
Years of Service
User Offline
Joined: 7th Dec 2003
Location:
Posted: 7th Dec 2003 19:29
i get the error just even randomizing where the pic goes of
#100012:could not close nest at line 43
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 8th Dec 2003 02:20
Working on a little example for you...

RPGamer


Dont forget to Join the Forums!
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 8th Dec 2003 02:41 Edited at: 8th Dec 2003 02:42


Thx Indi for helping me get unconfused

That code shows how to use TYPES and ARRAYS available in DBP. Use the demo if you dont have DBP. With that code 5 windows X and Y cordinates are stored in an array. In your loop generate a random seed between 1 and 5. If there are no other images on screen (use Sprites and say



That will tell you if no targets are up. Next, display a sprite at random



Control the clicking of the sprite using code I put in your other post....

And that should be about it. Course I didnt give you all the necessary code as that would be cheating on your course

RPGamer


Dont forget to Join the Forums!
Mico
21
Years of Service
User Offline
Joined: 7th Dec 2003
Location:
Posted: 17th Dec 2003 01:05
hey just about finished my game now, thanx for all the help, got a few problems though,
1. the crosshair when should go over celebrity goes under
2. when generating another celebrity to appear there is a flicker where another random celeb appears and disappears.
can someone plz take a look at my code and check to see where i could improve. thnx for the help so far and any help given from now on
Mico

Login to post a reply

Server time is: 2025-05-22 01:35:41
Your offset time is: 2025-05-22 01:35:41