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.

DarkBASIC Discussion / 2d problems!(sprite collision, text refresh)

Author
Message
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 28th Mar 2008 22:41
Hello, I don't have much experience with 2d in dbc, so I suspected a few problems like this and, I got them, wohoo!

Anyways, the problems I am having are the text is not refreshing(overlapping from last loop and my sprite collision isn't registering.



Ed222
18
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 28th Mar 2008 23:59
did you try to put a cls after the sync in the loop?

BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 29th Mar 2008 00:10
Here are what I saw:

1. Indent you loop so instead of this

it looks like this


this just makes it easier to read

2. The paste sprite actually just copies the sprite image to the screen, it doesn't move the sprite (if this is confusing, move the sprites location around and you'll see). Just use the sprite command.

3. Personally I have never had good luck with the hit commands (object hit or sprite hit). Try using the collision commands. This will also fix some problems where the object goes from not touching it to overlapping it due to the speed it is traveling

4. Use text commands, rather than print commands. Then make sure that you use cls in your loop AFTER sync (if you put it right before, you won't see anything)

Hope these tips help!

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 29th Mar 2008 00:17
NVM, thanks for your help, I actually tried using the sprite command before you posted and it worked. I will switch to the collision command, thanks for the advice.

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Mar 2008 02:39
If your sprites are solid primary colours you should read this if you are having collision problems:

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

TDK_Man

Login to post a reply

Server time is: 2026-07-05 15:24:50
Your offset time is: 2026-07-05 15:24:50