Help?! :)

BlitzMax Forums/BlitzMax Programming/Help?! :)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

BlitzMax 1.30

Hello ppl!

I'm pretty new when it comes to coding in blitzbasic (MAX). The reason I'm asking here, is because my text scroller seems to flicker/stutter. The flickering is kinda random, but it's really annoying. And I don't know why this small code should flicker like this.. Could any one give me a hint or a sollution of this problem? I have tried several ways, but the scroller just seems to shake or something. I got the same problem in every application I make in BlitzMax.

My specs are as follows:

CPU: AMD Athlon X2 6400+ dual core (3.2Ghz)
Graphics: EVGA e-GeForce 8800 GTS
Memory: 2GB
OS: Windows XP Pro
Latest DirectX/Soundcard/Graphics drivers

- The scroller code -
SuperStrict

Const W:Int = 640		' Height
Const H:Int = 480		' Width
Const D:Int = 0		' Depth (0 = window mode)

Graphics W,H,D

Global scrollList:TList = New TList
Global movespeed:Float=2.0

HideMouse

Type scroller
	Field x:Float
	Field y:Float
	Field char:String
		
	Method update()
		For Local s:scroller = EachIn scrollList
			s.x:-movespeed
			DrawText s.char,s.x,s.y
			If s.x<-50 Then scrollList.remove s
		Next
	End Method
	
	Function Create:scroller(x:Float,y:Float,char:String)
		Local s:scroller = New scroller
		s.x=x
		s.y=y
		s.char=char
		scrollList.addlast s
	End Function
End Type

' Scroller text
Local text:String

text="                          Hello ppl! This small scroller is kinda flickering and stuttering.. "
text:+" Why is it stuttering and flickering in BlitzMax??? ........................... "

Local wait:Int = 0
Local letter:Int = 0
Local s:scroller = New scroller

Repeat
	Cls
	If wait>5
		Local tmp:String=Mid(text,letter,1)
		Local s:scroller = New scroller
		s.Create(640,400,tmp)
		wait=0
		letter:+1		
		If letter > Len(text) Then letter=0
	EndIf
	wait:+1
	s.update
	Flip
Until KeyHit(KEY_ESCAPE)
End

-- End code --

Thanks in advance,
Docster