Please teach me to creare games in PB!

Advanced game related topics
VeryVeryWell
User
User
Posts: 35
Joined: Sat Jun 19, 2010 1:41 pm

Please teach me to creare games in PB!

Post by VeryVeryWell »

Please help me to create games in PB. Does anybody have manuals for PB 4.41?
I want to create a real-time strategy in network.

And another question: what will happen if many users connect to the standart Pure Server?

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - Network (Server) example file
;
;    (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;

If InitNetwork() = 0
  MessageRequester("Error", "Can't initialize the network !", 0)
  End
EndIf

Port = 6832
*Buffer = AllocateMemory(1000)

If CreateNetworkServer(0, Port)

  MessageRequester("PureBasic - Server", "Server created (Port "+Str(Port)+").", 0)
  
  Repeat
      
    SEvent = NetworkServerEvent()
  
    If SEvent
    
      ClientID = EventClient()
  
      Select SEvent
      
        Case 1
          MessageRequester("PureBasic - Server", "A new client has connected !", 0)
  
        Case 2
          MessageRequester("PureBasic - Server", "Client "+Str(ClientID)+" has send a packet !", 0)
          ReceiveNetworkData(ClientID, *Buffer, 1000)
          MessageRequester("Info", "String: "+PeekS(*Buffer), 0)
  
        Case 3
          MessageRequester("PureBasic - Server", "Client "+Str(ClientID)+" has send a file via the network !", 0)
          ReceiveNetworkFile(ClientID, "C:\TEST_Network.ftp3")
  
        Case 4
          MessageRequester("PureBasic - Server", "Client "+Str(ClientID)+" has closed the connection...", 0)
          Quit = 1
    
      EndSelect
    EndIf
    
  Until Quit = 1 
  
  MessageRequester("PureBasic - Server", "Click to quit the server.", 0)
  
  CloseNetworkServer(0)
Else
  MessageRequester("Error", "Can't create the server (port in use ?).", 0)
EndIf

  
End
Must I use many threads for every user?
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Please teach me to creare games in PB!

Post by Rook Zimbabwe »

So what other programming languages are you familiar with?
What games have you coded already?
Don't you think it would be better if you tried to write the game first THEN integrated C/S accessability?

To answer your questions outright... Yes, you can also create a MAP or copnnections as well.
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
VeryVeryWell
User
User
Posts: 35
Joined: Sat Jun 19, 2010 1:41 pm

Re: Please teach me to creare games in PB!

Post by VeryVeryWell »

Rook Zimbabwe wrote:So what other programming languages are you familiar with?
I don't know other languages...
Rook Zimbabwe wrote:What games have you coded already?
I have not coded games yet... Simply, I want learn: how it works.
I need free manuals.
Rook Zimbabwe wrote:Don't you think it would be better if you tried to write the game first THEN integrated C/S accessability?
OK. I will code simle game in first.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Please teach me to creare games in PB!

Post by c4s »

VeryVeryWell wrote:I have not coded games yet...[...]OK. I will code simle game in first.
So I think your question is solved then because if you really want to make games you have to start simple and even more important: You have to understnad the language you are programming with! My first game for example was "guess the number"...

By the way: The latest version of PureBasic is 4.50 with 4.51 as a release candidate. :?
(where is the *roll* smiley?)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
VeryVeryWell
User
User
Posts: 35
Joined: Sat Jun 19, 2010 1:41 pm

Re: Please teach me to creare games in PB!

Post by VeryVeryWell »

c4s wrote:
VeryVeryWell wrote:I have not coded games yet...[...]OK. I will code simle game in first.
So I think your question is solved then because if you really want to make games you have to start simple and even more important: You have to understnad the language you are programming with! My first game for example was "guess the number"...
I can't imagine how I can begin... I was learn all PB help. I try do something. I have read German manual for PB 3.xx (!). I need manuals in English.
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: Please teach me to creare games in PB!

Post by KJ67 »

You could get the latest manual from PureBasic's homepage, http://www.purebasic.com/documentation/PureBasic.pdf
The best preparation for tomorrow is doing your best today.
User avatar
PureLeo
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 29, 2010 1:05 pm
Location: Brazil

Re: Please teach me to creare games in PB!

Post by PureLeo »

4.41? :roll:

The mighty 4.51 is out, get its demo.
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: Please teach me to creare games in PB!

Post by LuCiFeR[SD] »

VeryVeryWell wrote:I can't imagine how I can begin... I was learn all PB help. I try do something. I have read German manual for PB 3.xx (!). I need manuals in English.
If you are a registered (as in paid money for purebasic) you can download the latest version from your purebasic user account... The documentation comes with it.

If you Downloaded it via a torrent or any other nefarious means, then sorry, you are out of luck as you will receive no help here... from myself, obviously I can't talk for others.
Last edited by LuCiFeR[SD] on Tue Aug 31, 2010 6:45 pm, edited 1 time in total.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Please teach me to creare games in PB!

Post by blueznl »

Unregistered users in the Netherlands can call the helpline 0909-7472837.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Please teach me to creare games in PB!

Post by Rook Zimbabwe »

OK I may break a rule... (hey the eye roll is MISSING!!!)

Look here: http://www.purearea.net

Try not to get distarcted by the DLL and libs... start withthe source code section... there are a couple of games there that you can see HOW they were coded (it is all source code)

READ the code... (RTFM as well!) as you don't actually know HOW to program you probably don't have any BAD habits to break... consider yourself lucky!

There are different approaches to applications and windowed code and full screen games... almost 3 different programming styles... (OK maybe 2-99)

BASIC allows you maximum flexibility in HOW you code. Follow the KISS rule and your PB programs will be fine! :mrgreen:

You might also read the Purebasic Survival Guide... Some boring old duffer put it together... I forget who... real long winded poster and know all busybody... :roll:

Dang I wish I could remember who wrote that up???

:wink:

(I am kidding Blueznl!!!)
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Please teach me to creare games in PB!

Post by blueznl »

The number of honorific tiles bestowed upon me is beyond comprehension.

(Duh! 8) )
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
VeryVeryWell
User
User
Posts: 35
Joined: Sat Jun 19, 2010 1:41 pm

Re: Please teach me to creare games in PB!

Post by VeryVeryWell »

LuCiFeR[SD] wrote:If you Downloaded it via a torrent or any other nefarious means, then sorry, you are out of luck as you will receive no help here.
When I will get 79 euro, I will buy full PureBasic. Unfortunately, I study at school. I have not money.
blueznl wrote:Unregistered users in the Netherlands can call the helpline 0909-7472837.
Thanks, but I am not from Netherlands.
Rook Zimbabwe wrote:OK I may break a rule... (hey the eye roll is MISSING!!!)

Look here: http://www.purearea.net
Oh! Thanks. I can't find it.

For PB admin:
Please add here http://purebasic.com/onlineordering.php PayPal, LibertyReserve and Russian system WebMoney (http://webmoney.ru/).
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Please teach me to creare games in PB!

Post by luis »

LuCiFeR[SD] wrote: you will receive no help here ...
missing text wrote: ... from myself, obviously I can't talk for others.
"Have you tried turning it off and on again ?"
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: Please teach me to creare games in PB!

Post by LuCiFeR[SD] »

luis wrote:
LuCiFeR[SD] wrote: you will receive no help here ...
missing text wrote: ... from myself, obviously I can't talk for others.
You are correct luis. I humbly apologise. I have edited my post above with the amended text.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Please teach me to creare games in PB!

Post by blueznl »

My favorite smiley must still be this one:

Image
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply