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 / Have some new Problems can any one Help me?

Author
Message
poorrican
14
Years of Service
User Offline
Joined: 1st Mar 2010
Location:
Posted: 3rd May 2010 03:56
ok im making a fighting game its due tommorow and the only reason im behind is because my partner dropped the class so i been really short on time since. so can anyone help me figured out whats wrong?
ok i got collisions to work but once one character gets hit he is the only one who can get hit how can i: 1. get them to move at the same time. 2. how can i get it to be when one player gets hit then the other one can get hit.









Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 3rd May 2010 08:52


Ima say it was probably a bad idea to try to write something for a school assignment...

you really haven't done much programming at all... just a lot of repetitive work. You're being a human number cruncher... but you're supposed to be giving the computer an algorithm to use, because computers can crunch numbers a million times faster.

I would say scrap this and go read some other tutorials, but it seems like you're down to the wire... Yoikes. Anyways, here are a couple things wrong with the code:



Sorry to say but... all that doesn't do anything... What happens when you run that is that the code doesn't go past there, OR update the screen, or check anything else, until that code has been run (which means all those wait statements). Basically, it changes the sprite a couple times in the same frame (meaning only the last sprite command is visible.

Right after most of those, you have a command like this:

which ensures any changes to the sprite in the above code are lost.

All the sync commands are also pretty much useless. they'll probably just end up updating the screen a couple times during the loop (which just wastes processing time).

The indenting, while not critical, needs a fixin'. I bet you kept looking back to make sure which endif or loop you had open or closed. A indenting scheme like this helps a lot:

or in other words, like this:


My main advice is this: Functions functions functions. Divide and conquer. I would make a function to display a certain portion of a sprite from a sprite sheet (which takes out the bulk of this:
)
and a function to handle animations. Once you get that working, your code might look more like this:

if you're wondering "What goes in handle_spritesheet_anim?", then THATs programming.

If you really really want to do this... then here's what you should do: hit up every tutorial you can find about DBPro game creation. Like the ones that walk you through from start to finish, and modify and build on the code however possible. Maybe pull an all nighter.

Stuff to think about a lot:
Sprite sheets and animation
for loops and arrays
your program flow (try to come up with a "first i do this, then this" scheme).

Godspeed.


TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd May 2010 20:34
Yes - have to agree that your code is pretty much a horrible mess.

You don't appear to have read any proper tutorials - or you've ignored those that you have read!

Like Neuro Fuzzy says, you don't write computer programs like that.

Dark Basic gives you programming tools to make many tasks easier and you simply haven't used any of them. And looking through your program, the commands you have used you don't appear to understand properly.

Sorry to be blunt, but from what I can see, pretty much everything you've done is wrong - or could be done better in a different (much easier) way.

I too can only wish you luck as it's a seemingly impossible task fixing it to work in 24 hours. If they are any help to you, my tutorials for beginners can be found here:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

What you need to know is covered in them, but going through them is s a time-consuming task and I think you've left it a little too late...

TDK

Login to post a reply

Server time is: 2024-11-24 17:59:30
Your offset time is: 2024-11-24 17:59:30