Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 6:52 pm

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
PostPosted: Wed Oct 14, 2009 4:31 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
http://web.miragesource.com/old-tutoria ... 20Tut.html

What would it take to properly optimize this system?


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 4:49 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
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 <= RainIntensity Then
            Call ClearRainDrop(BLT_RAIN_DROPS)
        End If
        frmMirage.tmrRainDrop.Tag = ""
    End If
   
    LeftRight = 0
   
    'actually blt the rain
    For i = 1 To MAX_RAINDROPS
        If Not ((DropRain(i).X = 0) Or (DropRain(i).Y = 0)) Then
            DropRain(i).X = DropRain(i).X + DropRain(i).speed
            DropRain(i).Y = DropRain(i).Y + DropRain(i).speed
            Call DDS_BackBuffer.DrawLine(ConvertMapX(DropRain(i).X), ConvertMapY(DropRain(i).Y), ConvertMapX(DropRain(i).X + DropRain(i).speed), ConvertMapY(DropRain(i).Y + DropRain(i).speed))
            If (DropRain(i).X > (Map.MaxX + 1) * PIC_X) Or (DropRain(i).Y > (Map.MaxY + 1) * PIC_Y) Then
                DropRain(i).Randomized = False
            End If
        End If
    Next i
End Sub


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 5:30 pm 
Offline
Knowledgeable
User avatar

Joined: Fri Feb 02, 2007 4:50 am
Posts: 263
Location: usa michigan centriville
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 ^^.

_________________
Fuck? I really joined in 2006.
Spirea, Chat Rooms, Discussions, Help. everything you need in one spot.
http://spirean.com
I love my computer, you never ask for more, you can be my princess or be my whore


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 5:43 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Most of that is already done with this system..


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 5:55 pm 
Offline
Knowledgeable
User avatar

Joined: Fri Feb 02, 2007 4:50 am
Posts: 263
Location: usa michigan centriville
from what i see you still got frmMirage.tmrRainDrop.Enabled = True
get rid of all timers =[ they are bad.

_________________
Fuck? I really joined in 2006.
Spirea, Chat Rooms, Discussions, Help. everything you need in one spot.
http://spirean.com
I love my computer, you never ask for more, you can be my princess or be my whore


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 6:29 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
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.


Top
 Profile  
 
PostPosted: Wed Oct 14, 2009 7:04 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
Posting in a locked topic!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group