Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need Advice On Code Planning For My First Game A Begginner

Author
Message
Red And Blue Eyes
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 22nd Jun 2004 15:15 Edited at: 22nd Jun 2004 16:54
Hi,

I Am Learning Now To Make A Game Just For Fun Wanne Now If I Can Make One. This Is My Game Idea Its Gonne Be In 3d And Its Gonne Be Crap But You Have To Start Somewhere.

The Main Idea Is.....

1 A Space Ship In Space Lands On Planet
2 Man Comes Out Of Ship Start Exploring Planet Finding Treasure

How Should I Setup My Main Code?

I Am Bad At Game Setup Can Some Of You Great People Give Me Some Advice On How To Setup My Code Whats The Best Way To Setup A Code.

Only Post If You Can Help

I Use Other People Code For My Own Bennefit Why Because I like It
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 22nd Jun 2004 21:11
woah, im new to darkbasic too but I have had some programming experience and I would suggest you start with pong. Go to the code base, look up the super commented pong and then see if you can tweak it to make a really fun game. Also check out my version "Bumper Pong". After you make Pong or whatever use the same princibles from the program and make Break Out (Which when I complete will be on code base). Then Make a Space Invaders type game but with people or something. Good luck and Take it slow you wont be able to make a full 3d movie sequence your first day!!
Red And Blue Eyes
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 23rd Jun 2004 13:48
Thanks For Trying To Help Me Skeletor But I Have Collected Lots Of Code Snippits From Other People Which I Am Going To Use In My Game I Need Only A Example Where To Put My Code Like Where To Put My Main Code, Where To Put My Sound Files, Where To Put Player Movement Code, So On So On
I Am A Beginner But I Am Learning My Way Thats Looking At Other People Code And Learning It.
I Can Make This Game I Think I Can But I Need A Advice On Code Planning.

Whats The Best Way To Setup A Game Code.

Only Post If You Can Help

I Use Other People Code For My Own Bennefit Why Because I like It
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 23rd Jun 2004 14:14
Usually code layout is done in functions or sub-routines. You would probably have something like...

`Declare variables here
`--------------------
`--------------------
`--------------------
gosub setup
gosub loadMedia

do
gosub playerMovement
gosub playerCollision
gosub handleEvents
gosub specialEffects
sync
loop

Or something like that. You should only use sync once in your code (unless you're doing cut scenes or menus or something). Make the code work within one loop, labels and gotos are messy, try to avoid using them. Use loops and larger if statements instead.

Athelon XP 1600+/Radeon 9600 Pro/256 RAM
Red And Blue Eyes
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 23rd Jun 2004 14:29
Thanks For Trying To Help Me Hamish You Give Great advice And You Helped Me Once On My Intro Giving Me A Great Camera Routine And Your Tutorials Are Great And I Am Waiting For Your Dark Fx Particle Program.

Hmmmmm I Think I Need To Learn More On The Gosub Command Before I Start To Make My Game.

Thanks For Helping Me Hamish.

I Use Other People Code For My Own Bennefit Why Because I like It
Filmmaker Screenwriter
21
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 23rd Jun 2004 17:25 Edited at: 23rd Jun 2004 17:27
Yeah, here's what I did to become more used to the commands in Dark Basic. Complete the fast-track and programming principles courses, then do the tutorials that come with DB.

Then, start to peruse through the demos that come with it (caverun, iced, jetski, room, etc) and try to figure out what the commands are doing, then tinker with the code and see what happens to the game.

Then of course, do the Monster Hunt and Binary Moon tutorials.

At this time, you should be familiar with most commands, but if there are some you still do not understand, look them up in the Examples help files and ask in this forum for some help.

Good luck making your game!

Pentium4 3GHZ, 512MB DualChannel RAM, 256MB ATI Radeon 9800XT, SoundBlaster Audigy2, 120 GB HD.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 23rd Jun 2004 20:55
Just keep plugging away. Work on tutorials, mini projects, but especially start projects that challenge your current skillset, you'll be looking up things in the help files a lot, but you'll be learning. Then once you become familiar with DarkBasic you'll be proficient with most variants of BASIC after learning the way their syntax is organized. Even makes it easier to transition to C++ in some cases.

The main commands you want a good hold of just so you can get your code organized are FUNCTION/ENDFUNCTION and GOSUB/RETURN. They're not too difficult.

I'm glad the first question you asked was how to PLAN your program. The downfall of many startup indie studios is lack of planning. Write out a main loop thing, like the one Hamish showed you.


`Declare variables here
`--------------------
`--------------------
`--------------------
gosub setup
gosub loadMedia

do
gosub playerMovement
gosub playerCollision
gosub handleEvents
gosub specialEffects
sync
loop


Take each of those subroutines and devote an entire sheet of paper to them. Plan out what they will do, and a little bit of how they will do it. Find out if you need any smaller subroutines to make work easier. For example:
The subroutine Load Media could be split into different chunks like: Load Player Objects, Load Level Objects, Load HUD images, etc. etc.

If you do it right each subroutine you write will be a learning experience and when you're done with the project you'll be pretty proficient at programming in DB

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html

Login to post a reply

Server time is: 2024-11-26 22:35:22
Your offset time is: 2024-11-26 22:35:22