Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm no good with optimizations..
#1
http://web.miragesource.com/old-tutoria ... 20Tut.html

What would it take to properly optimize this system?
#2
[code]Sub BltWeather()
Dim i As Long

If WeatherTick = 0 Then
WeatherTick = GetTickCount
End If

Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255))

If GameWeather = WEATHER_RAINING Then
For i = 1 To MAX_RAINDROPS
If DropRain(i).Randomized = False Then
If frmMirage.tmrRainDrop.Enabled = False Then
BLT_RAIN_DROPS = 1
frmMirage.tmrRainDrop.Enabled = True
If frmMirage.tmrRainDrop.Tag = "" Then
frmMirage.tmrRainDrop.Interval = 200
frmMirage.tmrRainDrop.Tag = "123"
End If
End If
End If
Next i
Else
If BLT_RAIN_DROPS > 0 And BLT_RAIN_DROPS
#3
hmm 0.0

Id say What you got there is close just get rid of the timer and make it Get tick.

also

Type DropRainRec
x as long
y as long
speed as byte
Randomized as byte
End Type

use byte instead of Boolean ^^. 1 or 0 Would work =].

and in the MapRec

add Weather() As byte
1 rain 2 thundering rain 3 snow ^^

you can Make them public Consent ^^ as well for the max amount of drops

Public Const MAX_BLTDROPS As Byte = 100

Reason for Adding to map is to allow Each map to be able to have a different Weather. like Mountains with snow then walk off rain forest woot.

You could also add a Gettickcount to Count down, to turn the Drops on and off for each map and Have a set variable In the map editor for it =].

If you ask why i use byte instead of Boolean because i think its faster ^^.
#4
Most of that is already done with this system..
#5
from what i see you still got frmMirage.tmrRainDrop.Enabled = True
get rid of all timers =[ they are bad.
#6
I said most. And I know timers are bad. I just wanted to get the other part fixed BEFORE I did that.

Anyways, thanks to Jacob, this is fixed.
#7
Posting in a locked topic!


Forum Jump:


Users browsing this thread: 1 Guest(s)