1. Delays in Programs
- Posted by Longlifter <LONGLIFTER at PRODIGY.NET> Nov 20, 1999
- 510 views
- Last edited Nov 21, 1999
------=_NextPart_000_0016_01BF338B.220B4D60 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Can someone supply me with some code on how to delay in a program? I've = seen it in many games when the creators name appears and then the screen = goes to the next virtual screen. Does a certain library do what I am = trying to achieve? I just mastered the font library today(big whoopie), = but I really need to move on in my game that I am starting. Can someone = help me out? ------=_NextPart_000_0016_01BF338B.220B4D60 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>Can someone supply me with some code on how to delay = in a=20 program? I've seen it in many games when the creators name appears = and=20 then the screen goes to the next virtual screen. Does a certain=20 library do what I am trying to achieve? I just mastered the font = library=20 today(big whoopie), but I really need to move on in my game that I am=20 ------=_NextPart_000_0016_01BF338B.220B4D60--
2. Re: Delays in Programs
- Posted by Irv Mullins <irv at ELLIJAY.COM> Nov 20, 1999
- 495 views
- Last edited Nov 21, 1999
----- Original Message ----- From: Longlifter <LONGLIFTER at PRODIGY.NET> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Saturday, November 20, 1999 10:12 PM Subject: Delays in Programs Can someone supply me with some code on how to delay in a program? I've seen it in many games when the creators name appears and then the screen goes to the next virtual screen. Does a certain library do what I am trying to achieve? I just mastered the font library today(big whoopie), but I really need to move on in my game that I am starting. Can someone help me out? You can use time().. procedure wait(atom delay) atom start, fini start = time() -- now fini = start + delay while time() < fini do end while -- loop end procedure wait(10) -- 10 seconds wait(.1) -- 1/10 second Irv
3. Re: Delays in Programs
- Posted by Longlifter <LONGLIFTER at PRODIGY.NET> Nov 21, 1999
- 481 views
(I am trying to start my game with the company name and delay it for a few seconds then change to the second page using virtual screens. Can you help me?) without warning without type_check include font.e include graphics.e include ecstacy.e include image.e include get.e include mode19.e -- declarations object junk atom delay integer cargo22,festus18,arial08 -- defines -- go to mode 19 junk=graphics_mode(19) tick_rate(100) --force use of vesa standard machine_proc(36,1) -- crash message crash_message("An unexpected error has occured.\n"& "Contact longlifter at prodigy.net\n"& "Do not delete the file \"ex.err\"") --1 -- Write Company name to the screen-- -- set background color bk_color(BLACK) -- load font of choice cargo22 = load_font ("cargo22.f") festus18=load_font("festus18.f") arial08=load_font("arial08.f") -- set the attributes for the text set_attributes(SHADOW) -- select a loaded font select_font (cargo22) --set text color set_foreground(BLUE) -- set background for text set_background(CLEAR) -- set x and y positions for text setx(30) sety(80) -- write to screen BLACK BIRD GAMES write("BLACK BIRD GAMES") --------------------------------------------- --2 -- Write "presents....." below "BLACK BIRD GAMES" -- select a loaded font select_font(festus18) -- set text color set_foreground(WHITE) -- set attributes set_attributes(SHADOW) -- set background for text set_background(CLEAR) -- set x and y positions for text setx(90) sety(130) -- write "presents....." to the screen write("presents.....") -------------------------------------------- set_active_page(1) clear_screen() select_font(arial08) -- select arial font set_foreground(WHITE) -- set text color to white set_background(CLEAR) -- set background for text set_attributes(SHADOW) -- set attributes for text setx(0) sety(320) -- set x and y positions for text write("Copyright(c)1999") -- write Copyright information. -- Here is where I tried to use your code, but I can't get it to work -- properly. procedure wait(atom delay) atom start, fini start = time() -- now fini = start + delay while time() < fini do end while -- loop end procedure set_display_page(1) -- screen output will now be displayed ----- Original Message ----- From: Irv Mullins <irv at ELLIJAY.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Saturday, November 20, 1999 6:33 PM Subject: Re: Delays in Programs > ----- Original Message ----- > From: Longlifter <LONGLIFTER at PRODIGY.NET> > To: <EUPHORIA at LISTSERV.MUOHIO.EDU> > Sent: Saturday, November 20, 1999 10:12 PM > Subject: Delays in Programs > > > Can someone supply me with some code on how to delay in a program? I've > seen it in many games when the creators name appears and then the screen > goes to the next virtual screen. Does a certain library do what I am trying > to achieve? I just mastered the font library today(big whoopie), but I > really need to move on in my game that I am starting. Can someone help me > out? > > You can use time().. > > procedure wait(atom delay) > atom start, fini > start = time() -- now > fini = start + delay > while time() < fini do > end while -- loop > end procedure > > wait(10) -- 10 seconds > wait(.1) -- 1/10 second > > Irv
4. Re: Delays in Programs
- Posted by RedWordSmith <redwordsmith at NIC.DREAMHOST.COM> Nov 21, 1999
- 492 views
Longlifter wrote: > -- Here is where I tried to use your code, but I can't get it to work > -- properly. > procedure wait(atom delay) > atom start, fini > start = time() -- now > fini = start + delay > while time() < fini do > end while -- loop > end procedure > > set_display_page(1) -- screen output will now be displayed I am just guessing (I'm very new to this), but if it is a procedure, shouldn't you call it somehow? I'm guessing adding a line that says: --begin for 5 second delay wait(5) --finis I tried to find a referance to wait using the search message feature, but I was unable to... -- "Only when no one replies to spam will it go away." If someone tries to sell you something via unsolicited email, don't buy it. See http://www.spamcop.net/ and fight back Nic (RedWord)Smith http://nic.dreamhost.com
5. Re: Delays in Programs
- Posted by Irv Mullins <irv at ELLIJAY.COM> Nov 21, 1999
- 472 views
----- Original Message ----- From: Longlifter <LONGLIFTER at PRODIGY.NET> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Sunday, November 21, 1999 8:15 PM Subject: Re: Delays in Programs > (I am trying to start my game with the company name and delay it for a few > seconds then change to the second page using virtual screens. Can you help > me?) > without warning > without type_check > > include font.e > include graphics.e > include ecstacy.e > include image.e > include get.e > include mode19.e > > -- declarations > object junk > atom delay > > integer cargo22,festus18,arial08 > > > > -- defines > > > -- go to mode 19 > junk=graphics_mode(19) > > tick_rate(100) > > --force use of vesa standard > machine_proc(36,1) > -- crash message > crash_message("An unexpected error has occured.\n"& > "Contact longlifter at prodigy.net\n"& > "Do not delete the file \"ex.err\"") > > --1 > -- Write Company name to the screen-- > -- set background color > bk_color(BLACK) > -- load font of choice > cargo22 = load_font ("cargo22.f") > festus18=load_font("festus18.f") > arial08=load_font("arial08.f") > -- set the attributes for the text > set_attributes(SHADOW) > -- select a loaded font > select_font (cargo22) > --set text color > set_foreground(BLUE) > -- set background for text > set_background(CLEAR) > -- set x and y positions for text > setx(30) sety(80) > -- write to screen BLACK BIRD GAMES > write("BLACK BIRD GAMES") > --------------------------------------------- > > --2 > -- Write "presents....." below "BLACK BIRD GAMES" > -- select a loaded font > select_font(festus18) > -- set text color > set_foreground(WHITE) > -- set attributes > set_attributes(SHADOW) > -- set background for text > set_background(CLEAR) > -- set x and y positions for text > setx(90) sety(130) > -- write "presents....." to the screen > write("presents.....") > -------------------------------------------- > set_active_page(1) > clear_screen() > > > select_font(arial08) -- select arial font > set_foreground(WHITE) -- set text color to white > set_background(CLEAR) -- set background for text > set_attributes(SHADOW) -- set attributes for text > setx(0) sety(320) -- set x and y positions for text > write("Copyright(c)1999") -- write Copyright information. > > -- Here is where I tried to use your code, but I can't get it to work > -- properly. > procedure wait(atom delay) > atom start, fini > start = time() -- now > fini = start + delay > while time() < fini do > end while -- loop > end procedure > > set_display_page(1) -- screen output will now be displayed Well, of course not, if you put it where your message indicates. The wait() routine, along with other utility routines, needs to go near the top of the program. You 'll be calling those routines from various places. Also, I can't see anyplace where you inserted a call to wait() between the three screens. It won't wait unless you tell it to :) Using set_active_page: A side note: I would try to break up the long chunks of code into smaller, easier to handle modules - something like the following: -- includes -- set crash message -- load fonts: constant festus = load_font("festus18.f") etc. -- select vga mode or abort procedure wait (atom seconds) ..... end procedure .... more utility stuff procedure ShowIntro1 () -- put intro part 1 screen code here end procedure procedure ShowIntro2 () -- put intro part 2 screen code here end procedure procedure LoadCopyright() -- put copyright code here -- which loads to page 1 end procedure -- more procedures having to do with game operations --Here's the main logic flow: ShowIntro1() -- Company name on page 0 wait(5) -- delay 5 seconds before printing the "presents" ShowIntro2() LoadCopyright() -- go ahead and load page 1 with the copyright notice wait(7) -- but wait 7 seconds before switching pages set_display_page(1) -- now flip to copyright page. wait(5) InitializeGame() while not finished do -- main game loop goes here, calling various game functions and procedures -- defined above, until done end while --Clean up and exit code goes here Regards, Irv
6. Re: Delays in Programs
- Posted by Irv Mullins <irv at ELLIJAY.COM> Nov 21, 1999
- 493 views
I just noticed that you had changed the tick_rate in your program. That will make the delays something other than 1 = 1 second. Either change tick_rate after the displays have been shown, or increase the value you are passing to wait() to compensate. Irv
7. Re: Delays in Programs
- Posted by Caballero Rojo <pampeano at ROCKETMAIL.COM> Nov 22, 1999
- 499 views
- Last edited Nov 23, 1999
Hello Longlifter, You can try a code that I made in a game that I'm devolping. Example: Of course you have to create an atom called t and replace basura for an object that in this case It's my garbage's object where I put all temporal variables. t=time()+5.30 while time()<t do basura = get_key() if basura != -1 then exit end if end while -- Best regards, Caballero Rojo mailto:pampeano at rocketmail.com Sunday, November 21, 1999, 10:15:45 PM, you wrote: L> (I am trying to start my game with the company name and delay it for a few L> seconds then change to the second page using virtual screens. Can you help L> me?) L> without warning L> without type_check L> include font.e L> include graphics.e L> include ecstacy.e L> include image.e L> include get.e L> include mode19.e L> -- declarations L> object junk L> atom delay L> integer cargo22,festus18,arial08 L> -- defines L> -- go to mode 19 L> junk=graphics_mode(19) L> tick_rate(100) L> --force use of vesa standard L> machine_proc(36,1) L> -- crash message L> crash_message("An unexpected error has occured.\n"& L> "Contact longlifter at prodigy.net\n"& L> "Do not delete the file \"ex.err\"") L> --1 L> -- Write Company name to the screen-- L> -- set background color L> bk_color(BLACK) L> -- load font of choice L> cargo22 = load_font ("cargo22.f") L> festus18=load_font("festus18.f") L> arial08=load_font("arial08.f") L> -- set the attributes for the text L> set_attributes(SHADOW) L> -- select a loaded font L> select_font (cargo22) L> --set text color L> set_foreground(BLUE) L> -- set background for text L> set_background(CLEAR) L> -- set x and y positions for text L> setx(30) sety(80) L> -- write to screen BLACK BIRD GAMES L> write("BLACK BIRD GAMES") L> --------------------------------------------- L> --2 L> -- Write "presents....." below "BLACK BIRD GAMES" L> -- select a loaded font L> select_font(festus18) L> -- set text color L> set_foreground(WHITE) L> -- set attributes L> set_attributes(SHADOW) L> -- set background for text L> set_background(CLEAR) L> -- set x and y positions for text L> setx(90) sety(130) L> -- write "presents....." to the screen L> write("presents.....") L> -------------------------------------------- L> set_active_page(1) L> clear_screen() L> select_font(arial08) -- select arial font L> set_foreground(WHITE) -- set text color to white L> set_background(CLEAR) -- set background for text L> set_attributes(SHADOW) -- set attributes for text L> setx(0) sety(320) -- set x and y positions for text L> write("Copyright(c)1999") -- write Copyright information. L> -- Here is where I tried to use your code, but I can't get it to work L> -- properly. L> procedure wait(atom delay) L> atom start, fini L> start = time() -- now L> fini = start + delay L> while time() < fini do L> end while -- loop L> end procedure L> set_display_page(1) -- screen output will now be displayed __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com