Problem with Pong

Just starting out? Need help? Post your questions and find answers here.
Slyde
New User
New User
Posts: 3
Joined: Thu May 01, 2003 11:46 pm

Problem with Pong

Post 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

WolfgangS
Enthusiast
Enthusiast
Posts: 174
Joined: Fri Apr 25, 2003 3:30 pm

Answers

Post 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
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

Slyde
New User
New User
Posts: 3
Joined: Thu May 01, 2003 11:46 pm

Post by Slyde »

Sorry but i dont understand Deutch Only french and english
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post 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.
Slyde
New User
New User
Posts: 3
Joined: Thu May 01, 2003 11:46 pm

Post by Slyde »

i was talking about robsite.de
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post 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.
Post Reply