My guess is that there are three problems:
1. Director parses strings slowly, so any repeated string wrangling and
putting will tend to slow things down a great deal.
This leads to
2. This script reveals no reason to update those fields THAT often.
A good rule of thumb is to update info only when the info needs
updating.
3. EnterFrame handlers tend to perform badly, as they are called just
after the stage is redrawn. Try using exitFrame or prepareFrame
Bringing the point update code together could help:
on exitFrame me
if sprite 17 intersects sprite(me.spritenum) then
sprite(me.spritenum).loch=-200
pPoint=pPoint+1
put pPoint into member"pointKeeper"
end if
end
On a similar note, if your timer is bogging things down, consider
whether you really need it to display the time in EVERY frame turnover.
Why not every 10th frame - or 30th, dpending on your frameRate? Your
goal is to make the end user understand that there's a timer running. Go
for the least amount of CPU work to achieve this goal.
--frame or sprite script:(untested)
property pTimex, pCounter, pLimit
on beginSprite me
pTimex = 0
pCounter = 0
pLimit = 30 --your choice here
end
on exitFrame
pTimex=pTimex+1
pCounter = pCounter + 1
if pCounter >= pLimit then
put pTimex into member "timerz"
pCounter = 0
end if
go the frame
end
HTH, Clars
Jonathan wrote:
>
> I have a game with a point scoring system and a timer.
> The problem is the frame where the two feild display these values'. It seems
> to slow the whole production down, to a point where it is jerky.
>
> This is an example of a a scoring system, attatched to a object with a score
> of 1.
> Global pPoint
>
> on enterframe me
>
> put pPoint into member"pointKeeper"
>
> if sprite 17 intersects sprite(me.spritenum) then
> sprite(me.spritenum).loch=-200
> pPoint=pPoint+1
> end if
> end
>
> This is the timer :
>
> on exitFrame
> pTimex=pTimex+1
> put pTimex into member "timerz"
> go to the frame
> end exitFrame
>
> Can anybody see where the problem is, I know it has something to do with
> this because I have the exact same sprites in another frame just without the
> score and the timex.
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
> email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]