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.

Dark GDK / Game WIP (noob) Progression Advice please?

Author
Message
Moops
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location:
Posted: 12th May 2010 22:21
Hiya Guys wonder if you could help me please, I'm new to the whole programming thing in fact up until about 4 weeks ago I had no idea what variables was. I've been playing games since the 80's and decided at my age before it was too late to attempt to learn some basic programming. Like others I did some research, found c++ to be of a quality standard and set out find a simple yet quality game engine. Long story short I found myself with VC++ and DarkGDK.

Now I've basically had a crash course in C++, watching hours upon hours of tutorial videos, reading countless pages from books and forum threads and attempted over the past 2 week to try and get something visual to the screen. I've compile a simple game, based upon asteroids and after alot of head banging I've decided to post what I've completed so far and to ask if I am going in the right direction and specifically what obstacles I may come across with the way in which I have structured my code.

At the moment im struggling to integrate my bullet code to kill my enemies, I don't seem to be able to get my array to be visible globally to enable me to compile some (hitenemy) code and could do with some assistance with this if possible please.

Plus any other advice, suggestions would be wonderful.

I've attached a zip file of my complete project, it's 6meg in size due to the textured asteroids sorry about that, however the project is complete and should open and compile right up in VC++ Version9

This may also help other new comers to C++ and DarkGDK because im sure my code will be very rough and noobish yet will have some very basic first step compiled code.

Cheers guys

Moops

Attachments

Login to view attachments
haliop
User Banned
Posted: 12th May 2010 23:56 Edited at: 13th May 2010 00:30
sure man , glad there is a new member in our forum.
lets see what youve done , and hopefully i will be able to help you with the Code.

edit: sorry but i do not have DarkAi.
can you explain what is the problem?
what happens when you press the fire button?

on the other hand i did find something that was a bit hard for me to understand.



here is my problem with it :
you have

at the end of the function , why not including a dbYRotateObject(iPlayerYangle) aswell..
it will make your project much more cleaner , you dont need to put it inside every key check:

at the start just declare int iPlayerYangle, then change only this and in the end only one dbYRotateObject , you have done it with dbPositionObject thats why it was a bit weird.

another problem that does bug me , is that you always put dbRotateObject(player,90,direction,0);
why always use that 90?
since you are using sparky collision and i for personal use know that this salution may not work with it.

dbXRotateObject(player,90);
dbFixObjecrPivot(player);

this will save it so you wont have to rotate it on the X axis everytime.
remmber , thats a rule and its the most important one in Media or Game programming , always try to keep the fps high, now this is a small for say project but when you come to a big one and this type of coding found that may defenetly decrease your fps.

about Sparky's collision ObjectPivot problem ,
you can create a mesh from the player object fix its pivot and return it to an object it worked for me.
the code is:



for now , since i cant compile and i do not want to change the code and actually follow your steps, i do now own DarkAi therefor cannot run it and see what happens with the bullets and im pretty damn tired.

explain what is the problem and i will try my best.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 13th May 2010 00:53 Edited at: 13th May 2010 00:55
Quote: "edit: sorry but i do not have DarkAi."


His program doesn't actually use DarkAI (yet?).

Comment out where it's included and go to Project->(Project) Properties...->[+]Configuration Properties->[+]Linker->[Input]

Change the configuration to "All Configurations" at the top, and then unreference both libs in "Additional Dependencies." Click OK and then build.

"A computer once beat me at chess, but it was no match for me at kick boxing."
Emo Philips
Moops
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location:
Posted: 13th May 2010 01:18
yes sorry indeed the actual game doesn't use DarkAI yet, sorry about that, I did have a go at implementing it, but I need to learn to walk before running.
haliop
User Banned
Posted: 13th May 2010 02:05 Edited at: 13th May 2010 02:10
oww , ok.
ok cool, i saw the problem while playing , i'll go over the code tommarow if no one beat me to it.
its 2:10 am.. damn why dont i sleep
haliop
User Banned
Posted: 14th May 2010 01:17
im sorry i havent got a chance to sit on it today , i'll try to see if i have time tommarow.
Moops
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location:
Posted: 14th May 2010 10:29
That's OK, time is of great value to everyone. I was hoping for general feedback from all, however it would appear that perhaps these forums may not be the best place for general advice.

Which is not a problem it's just another opportunity to socialise elsewhere.
haliop
User Banned
Posted: 16th May 2010 07:59
im sorry man i honestly thought like you that more ppl will help i just got a load of work and honestly cant find time to sit on it.

generally what you need to do as i played your game a bit.

when your bullets hits a target (asteroid) , it dissapers right?
meaning that collision is working, i didnt watched the code but i guess youve put


what you need to do is , when the bullet == hit , decrease an amount of the Hitten Asteroid, so each hit is - 10 for example
when the asteroid gets to 0 it disapper and you delete it from the array of "Enemy" or something similar that you probably did.

can anyone help Moops?
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 17th May 2010 02:11
At first glance, this doesn't seem to be a very C++-oriented way of coding. More procedural than object-oriented, anyway. But it does suit well with how the GDK is written.

I'd still advise that you read up on the struct and class types in C++ and see how you can use them to wrap much of what you do often. It can save you a lot of work and make the code more modular.
Moops
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location:
Posted: 17th May 2010 12:22 Edited at: 17th May 2010 12:22
Thanks entomophobiac, I was pretty sure this comment would come back, I guess in the 5 weeks I've been learning, one of the hardest things for me to grasp has been classes/pointers.

I've scrapped the above project, it was useful excersise. I think I'll start on OOP with some 2D stuff and see if I get anywhere.

Are their any frameworks which should be followed, or tutorials of how to create such a framework.

I want to start with some sort of top down shooter, perhaps just like Asteroids or Geometry Wars. Im after a tutorial which goes through the structure and explains why more than here is your structure.

With alot of C++ tutorials Ive read recently, they all explain how to do something, but tend to shy away from why and how this is integrated into your main project.

Cheers

Moops
haliop
User Banned
Posted: 17th May 2010 13:29
i agree its hard to find a good c++ book.

find "Learning C++ using games" or soemthing like that , i cant remmber the exact name.

Login to post a reply

Server time is: 2024-11-19 23:02:43
Your offset time is: 2024-11-19 23:02:43