Page 1 of 1

Problem with Pong

Posted: Thu May 01, 2003 11:49 pm
by Slyde
Hi i am new to PureBasic and

I
got some question:
How make a backbuffer
How Flip
How do we need need to clean it with command
How Display sprite ((in my code it not working))

N.B:Below is my first and is inomplet what is better to do

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Testing Pure Basic;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
InitSprite()
OpenScreen(640,480,16,"")
InitKeyboard()
InitSound()
SetFrameRate(60)
LoadSprite(0,"ball.bmp",0)
LoadSprite(1,"bat.bmp",0)
LoadSprite(2,"bat.bmp",0)
Global playerx
Global pLayery
Global opponentx
Global opponenty
Global ballx
Global bally
Global opponentScore
Global PlayerScore
playerx=0
playery=240
opponentx=640
opponenty=240
ballx=5
bally=5
opponentscore=0
playerscore=0
Procedure SetPlayer()
DisplaySprite(1,playerx,playery)
EndProcedure
Procedure SetOpponent()
DisplaySprite(2,opponentx,opponenty)
EndProcedure

Repeat
ExamineKeyboard()
SetPlayer()
SetOpponent()
Until KeyboardPushed(1)

End


Answers

Posted: Fri May 02, 2003 4:27 am
by WolfgangS
How make a backbuffer
You don´t need it
How Flip
FlipBuffers()
How do we need need to clean it with command
ClearScreen(R, G, B)
How Display sprite ((in my code it not working))
Look to the sprite.pb example in PureBasic\Examples\Sources directory

MFG
WolfgangS

PS: look at http://www.reelmediaproductions.com/pb/ and http://www.robsite.de/tutorials.php?tut=purebasic. There are a few beginners tutorials

Posted: Fri May 02, 2003 4:53 am
by Paul

Posted: Fri May 02, 2003 4:39 pm
by Slyde
Sorry but i dont understand Deutch Only french and english

Posted: Fri May 02, 2003 5:27 pm
by Henrik
Paul wrote:
Also look here for PBPong
http://www.reelmediaproductions.com/pb/gamesinpb.html
Slyde wrote: Sorry but i dont understand Deutch Only french and english
Hi Welcome Slyde :)
And Come on Slyde Poul gave you a link to a lot of easy to understand Code Snippets, apps, tutorials and other stuff, most in english.
in fact i just looked the source Poul suggest, very easy to understand and not one single word of German in it. Pure English.. :twisted:

bedst Regards
Henrik.

Posted: Mon May 05, 2003 1:25 pm
by Slyde
i was talking about robsite.de

Posted: Mon May 05, 2003 6:07 pm
by Henrik
Slyde wrote:i was talking about robsite.de
Oops :oops:
I'am sorry Slyde, i surely hope you did'nt get offended.
it was'nt ment as hard as it maybe came out "Looking back at my post now"
Bedst Regards
Henrik.