iNET Interactive - Online Advertising Agency
          
Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > About timers


Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2003, 10:38 AM
azzazzinz85 azzazzinz85 is offline
Freshman
 
Join Date: May 2003
Posts: 26
Default About timers

Hi there, I got a question concerning timers (I think).
I'm making an RPG like Final fantasy, very simple of course, and Before any one can attack in a fight a time meter (a shape) should be full before you can attack, but how can I do that.. I tried something like:

Shape1.width=shape1.width+(player speed)

If shape1.width=> X then....

Loop

Obviously it didn't work...
Thanks a lot.
Reply With Quote
  #2  
Old 06-01-2003, 10:43 AM
vb-dred vb-dred is offline
Centurion
 
Join Date: Nov 2002
Location: UK
Posts: 174
Default

i made 1 just similar to yours, look at the screenshot www.kidmania.8k.com/ss.jpg

anyway, i lost the coding for it.. sorry
__________________
abracadabra
Reply With Quote
  #3  
Old 06-01-2003, 12:53 PM
Mad_Kitten's Avatar
Mad_Kitten Mad_Kitten is offline
Junior Contributor
 
Join Date: Feb 2003
Location: Belgium
Posts: 383
Default

Maybe you could use timer. Set interval=1.

Code:
Private Sub Timer1_Timer() shape1.Width = shape1.Width + 10 'or surtain amount you want to add every millisecond If shape1.Width >= X Then 'attack is possible End Sub
Reply With Quote
  #4  
Old 06-02-2003, 05:57 AM
AndreRyan AndreRyan is offline
Contributor
 
Join Date: Jan 2002
Posts: 489
Default

Timers only execute once every 55ms on 95/98/ME and 10ms on 2000/XP therefore a timer cannot be set to 1 because it will still delay.

If you can a bit more specific about the "meter", it would be easier to understand what your're doing. If it just expands then place a timer(as long as you don't need precision) and increase the width.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Transitions and Timers Spadge General 2 11-28-2002 08:40 PM
Array of timers emoreira General 10 10-03-2002 08:03 AM
Timers deepblue General 5 02-28-2002 02:50 AM
Need help with timers and progress bar mhsueh001 Database and Reporting 2 02-22-2001 08:08 PM

Advertisement: