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 tile based game

Author
Message
leo the lion 0
19
Years of Service
User Offline
Joined: 4th Nov 2006
Location:
Posted: 4th Nov 2006 18:38
ok, I'm new to DarkBasic and I've just finished my first pong game, now I'm moving on to something more complicated, so I wrote this code, none of this is final, it is just my first test, and it takes ages to load the images. Could anyone help me by showing the proper way to do it.
p.s. I only have DarkBasic classic
Lucifer
20
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 4th Nov 2006 22:04
how do you make a pong game? i dont get how it is supposed to be so easy.. i mean, you have to calculate where the ball goes when it hits the thingy.. that doesnt sound so easy...



One is the lonliest number...
RUCCUS
21
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 4th Nov 2006 22:15
It uses some basic trig Lucifer. Check out chris k's tutorial on pong.

Your signature has been erased by a mod because it's larger than 600x120...
Gamedesign er20
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 5th Nov 2006 01:48
I just tried his code, and I really don't think he's trying to make a pong game. Especially since he just said
Quote: "ok, I'm new to DarkBasic and I've just finished my first pong game, now I'm moving on to something more complicated"
. Then again, I don't really know that was just my theory.

Cocacola and Pepsi aren't that differnt. Deal with it.
RUCCUS
21
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 5th Nov 2006 02:54
I was pointing the thread out to Lucifer, as he was wondering how newcommers are making pong games.

Your signature has been erased by a mod because it's larger than 600x120...
UFO
20
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 5th Nov 2006 03:49
Its weird. I tried making pong a while ago, but I couldn't get it to work right. It makes me frustrated, cause now I'm working on much more complicated games, and I can't even do pong :'-(

Anyway, back on topic.

leo the lion 0 - Would you mind posting the tiles.bmp image? If you do that, I will be able to run it and figure it out. I'm not very good at just looking at code. I couldn't find anything wrong with it though.

Thanks

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Nov 2006 04:31
just replace this line load bitmap "tiles.bmp"

with an ink and box command, it will be solid colours to see the result this way.

leo the lion 0
19
Years of Service
User Offline
Joined: 4th Nov 2006
Location:
Posted: 5th Nov 2006 11:05
Ok maybe I should explain what I'm trying to do. Remember those old tile based rpg's, like legend of zelda and all of those. I'm trying to make one of those. Thiat code is supposed to display the tiles on the screen and theres a character sprite you can move around. The game will determine what tiles are where by use of an array, my test array will just display a whole screen full of my ground tiles. The test array is undertown$. My problem is this, it takes ages to display all of the floor tiles onto the screen and it does this every time the player moves.I want to know if there is a way to either, not use the cls command, and so stop the program from having to reload the tiles every time, or a way to speed up my code so the tiles load quickly.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Nov 2006 00:11
You just need to use "sync rate 0" and "sync on" at the top of your code. That tells Darkbasic that you want to control when the screen updates. Every time you want the screen to update you use "sync" (after pasting all the tiles). Without "sync rate" and "sync" it will redraw the whole screen when you do anything... even drawing a single dot.

I personally like using "sync rate 0" because it goes at the speed of the computer running the program but you can use any number between 0 and 1000.

Login to post a reply

Server time is: 2026-07-07 00:09:57
Your offset time is: 2026-07-07 00:09:57