Main Menu

Game Programming Tutorials

Started by kevin, May 29, 2005, 09:34:58 AM

Previous topic - Next topic

Would a set PlayBasic based Game Programming tutorials be of use ?

Yes - I'm new and have no idea how games are created
11 (28.9%)
Yeah - I'd love to learn more about game creation with PlayBasic
23 (60.5%)
Maybe - Depends on what topics are covered
1 (2.6%)
Not really - I've been coding for years.  But I could write some
3 (7.9%)
Nah - Heaps of stuff of game programming on the net
0 (0%)
No - Not interested
0 (0%)
0 (0%)

Total Members Voted: 32

kevin

I've been mulling over the idea of starting/adding  a simple set of a game programming tutorials to underware design. These tutorials would be based upon PlayBasic of course.  Nothing too radical, just something to take the new programmers through the basics of how various game types work.  or smaller topics dealing with data management techniques..

The issue for me is time, or should i say a complete lack of it.  I really don't want to start something that I know is doomed from the outset for lack of time and or interested.  So would people be willing to contribute their time and energy to writing tutorials also ?.

kevin

ok, we've got a few votes.   So does anybody have  some ideas on what tutorial topics might be of use?

tomazmb

#2
Hello Kevin,

1. Save and Load game (how to freeze the screen and everything on it and save it and later load it).

2. Moving a sprite, setting a collision, reacting upon it...

3. Creating an isometric 2D world and moving sprites (objects) on it - Diablo 2 style or C&C style

4. How to use music in the game (and sound effects)

5. How to setup a radar screen or RPG screen (with multiple windows, one for character abbilities, one for his equipment, ...)

Have a nice day,

Tomaz
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c

Draco9898

you don't "freeze the screen"  :rolleyes: You just save all the data to a file in a certian order and then load it back into arrays or types in the same order.
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

dangerousbrian

Quoteok, we've got a few votes.   So does anybody have  some ideas on what tutorial topics might be of use?

I used to do some simple programming 30yrs ago with BBC Basic, Spectrums, Colour Genie etc., but things have moved on so much I don't know where to start! (I did have some success with DarkBasic, but that was because there was a very good manual in the box...). I personally would benefit from simple instructions on how to create a sprite from a picture (Is black invisible?), in order to get a horse galloping across a screen. (Eventually I want to get a decent background scrolling backwards as six horses run forwards)

DangerousBrian

Draco9898

#5
QuoteI used to do some simple programming 30yrs ago with BBC Basic, Spectrums, Colour Genie etc., but things have moved on so much I don't know where to start! (I did have some success with DarkBasic, but that was because there was a very good manual in the box...). I personally would benefit from simple instructions on how to create a sprite from a picture (Is black invisible?), in order to get a horse galloping across a screen. (Eventually I want to get a decent background scrolling backwards as six horses run forwards)

DangerousBrian

Black RGB(0,0,0) is invisable, but you can set your own color transparency. Y9ou need to load a bitmap into a temperary image number and then "rip" the picture up into different images


Here's code from my game to load a lives icon image and subimages
PlayBASIC Code: [Select]
Dim LifeImg(1): Dim LifeImgDraw(1)
LifeImg(1)=GetFreeImage(): LoadImage "Images\Etc\BunnyLives.Png",LifeImg(1)
Dim LifeNumImgs(10): TempImage=GetFreeImage()
LoadImage "Images\Etc\LifeNumbers.Png",TempImage: RenderToImage TempImage
For X=0 To 9
LifeNumImgs(x+1)=GetFreeImage()
GetImage LifeNumImgs(x+1),0+(15*X),0,15+(15*X),15
Next X
RenderToScreen: DeleteImage TempImage


DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

dangerousbrian

QuoteBlack RGB(0,0,0) is invisable, but you can set your own color transparency. Y9ou need to load a bitmap into a temperary image number and then "rip" the picture up into different images
Here's code from my game to load a lives icon image and subimages

Dim LifeImg(1): Dim LifeImgDraw(1)
 LifeImg(1)=GetFreeImage(): LoadImage "Images\Etc\BunnyLives.Png",LifeImg(1)
 Dim LifeNumImgs(10): TempImage=GetFreeImage()
 LoadImage "Images\Etc\LifeNumbers.Png",TempImage: RenderToImage TempImage
 For X=0 To 9
  LifeNumImgs(x+1)=GetFreeImage()
  GetImage LifeNumImgs(x+1),0+(15*X),0,15+(15*X),15
 Next X
 RenderToScreen: DeleteImage TempImage

Thanks Draco, really appreiciate your help, I'm now presuming I have to load bitmaps into a source file, then cut out the bits I need for sprites..., rather like darkbasic. What would be really useful is a manual of syntax commands with instructions on usage. I think I'm being far to ambitious for my first programme!
dangerousbrian

kevin

#7
QuoteI used to do some simple programming 30yrs ago with BBC Basic, Spectrums, Colour Genie etc., but things have moved on so much I don't know where to start! (I did have some success with DarkBasic, but that was because there was a very good manual in the box...).  

While i'll admit a printed manual would be beneficial, but at this point everything is evolving so fast it'd be obsolete before it end got back from the printers.  So for now, the help system is built into the IDE, it can also be browsed by with your favorite web browser.  

 The easiest way to view help is through the 'book' icon in the IDE's tool bar panel.  But I'm sure you've already found that.  But something that is largely unknown though, is that the IDE has command help short cuts built into right into it.  By that i mean, if you load an example piece of code, then move the mouse pointer over a command and press the "F1" key, it will take you to that commands descriptions in the help files.


QuoteI personally would benefit from simple instructions on how to create a sprite from a picture (Is black invisible?)

Yes, Black or RGB(0,0,0) is considered to be the transparent image colour.   You can also change the transparent to anything you like (need to).  People often use a bright purple colour Rgb(255,0,255), as it stands when their drawing their art work.  

Bellow is a simple example of grabbing sections of an image (the screen in this case) and make them into an Image.  These images can then be drawn using the DrawImage command, or assigned to sprites...


PlayBASIC Code: [Select]
; Draw some randomly coloured/positioned circles to top left section of
; the screen
For lp=0 to 10
x=rnd(100)
y=rnd(100)
radius=rndRange(10,20)
CircleC x,y,radius,1,RndRgb()
Next

; Get the top region of the screen as IMage #1
GetImage 1,0,0,25,100

; Get the next region of the screen as IMage #2
GetImage 2,25,0,50,100

; Get the next region of the screen as IMage #3
GetImage 3,50,0,75,100

; Get the next region of the screen as IMage #4
GetImage 4,75,0,100,100

print "Press any key to continue"
sync
waitkey
waitnokey



; Clear the Screen to bright blue colour
Cls rgb(0,0,255)


DrawImage 1,0,100,0
DrawImage 2,25,100,0
DrawImage 3,50,100,0
DrawImage 4,75,100,0


; Draw our set of grabbed images again, this time spaced out

DrawImage 1,100,200,0
DrawImage 2,200,200,0
DrawImage 3,300,200,0
DrawImage 4,400,200,0

print "Press any key to end"

sync
waitkey






123456789

You really should make a tutorial that takes you through the creatoin of a pong or asteroids rip-off game, that would really be of help to people like me who have no experience whatsoever in programming but want to learn.

dangerousbrian

A tutorial that demonstrates how to take a picture that I have drawn in another program and turn it into a sprite would be very helpful to me. I know there are sprite creation demos about, but I can't find one that shows how to use an outside image as a sprite. (I've managed to load images into my project & use them instead of sprites).

Kevin, Did you receive my email, I'm looking for a professional programmer to write for me.

DangerousBrian

Draco9898

#10
QuoteA tutorial that demonstrates how to take a picture that I have drawn in another program and turn it into a sprite would be very helpful to me. I know there are sprite creation demos about, but I can't find one that shows how to use an outside image as a sprite. (I've managed to load images into my project & use them instead of sprites).

Kevin, Did you receive my email, I'm looking for a professional programmer to write for me.

DangerousBrian

I might be able to code for you, PM me with details if you wish, I'm just not as good as kevin obviously :) But I'm ok


I might write some tuts later on If I find I'm bored enough, and many of these things seem simple enough to demostrate, shouldn't take long...
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin

#11
ok, i think what we'll do in the short term is split the Source Code forum into a Sources Codes and Tutorials forum.   So anybody who feels they can write a tutorial can do so now and have a place to publish it / get feedback.  

I probably won't have time to write something until the current update is complete.  Even then just small tidbits.

just dave

#12
Hi  :) very very new to this, never done any program writing, and was'nt expecting so much reading up on playbasic before i installed, but basically im so new i hav'nt a clue where to start or what to start with, and some basic tutorials would come in handy to get me started here, bearing in mind i only have 30 days to get into this, any help and surjestions would be greatfully recieved, although im new to game programming, i have been into 3d apps for a number of years, and looking to use them skills in my game making, so its just the writing i need help with, thx Dave

Draco9898

Alright, split the fourm sections and I'll start brewing up some simple tutorials
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

just dave

cool i cant wait, i have been playing around with codes i have come across and got things to happen, would like to know how lol, and it seems most grafics are code rather than image's, any rason for this, i was hoping that creating my own image's would save on codes is this true or false?, sorry for such easy questions but as i said very new to this, thanks Dave