2.5d game

Announce your Work In Process and finalized projects here.
Post Reply
Karlgamer
Newcomer
Posts: 4
Joined: Fri Feb 08, 2008 11:05 pm

2.5d game

Post by Karlgamer »

So this is the beginning to a game I want to write.

OH LEFT and RIGHT ARROW KEYS ROTATE! ....sorry....

There wasn't a SWAP command for my bubble sort so I had to do it the old fashion way.

It needs a lot of work. I'm kind of a little shy about my coding and work however I would be glad to answer any questions ("how'd you do that?") type stuff with actual code.

Heres my bubble sort and why I needed a SWAP.

Code: Select all

Repeat
inorder = True
For sort = 0 To tilenum-1
If Draworder(sort,2) < draworder(sort+1,2) Then

// swaps two tile orders
For swapnum = 0 To 2
swap(swapnum) = draworder(sort,swapnum) 
draworder(sort,swapnum) =draworder(sort+1,swapnum)
draworder(sort+1,swapnum)=swap(swapnum)
Next swapnum

inorder = False
EndIf 
Next sort
Until inorder = True
Attachments
2.5game.rar
here it is
(593.42 KiB) Downloaded 605 times
Aavesoturi
Active Member
Posts: 163
Joined: Fri Aug 31, 2007 7:07 pm
Location: Helsinki
Contact:

Re: 2.5d game

Post by Aavesoturi »

Never use bubble sort - it is one of the slowest (or maybe even the slowest) sort available. It doesn't make a big different if a list-to-be-sorted is very small, but with a bigger, you immediately run into performance troubles. Try combsort instead; it is much faster and has a ready implementation for CoolBasic: http://cbkk.systec.fi/koodi.php?id=44
Karlgamer
Newcomer
Posts: 4
Joined: Fri Feb 08, 2008 11:05 pm

Re: 2.5d game

Post by Karlgamer »

Aavesoturi wrote:Never use bubble sort - it is one of the slowest (or maybe even the slowest) sort available. It doesn't make a big different if a list-to-be-sorted is very small, but with a bigger, you immediately run into performance troubles. Try combsort instead; it is much faster and has a ready implementation for CoolBasic: http://cbkk.systec.fi/koodi.php?id=44
Sorry I can't make heads or tales for your code...
that is, its probably really good and if it is faster then I would love to use it, however I need more information on how this type of sort work....

basically ...

I need to write it myself so I need the concept more then the code.

Something I would like is any advice on how the make walls and slants using the tools available in cool basic.

I have recently made a wall. It uses strips of an image to make the skew.
Question "is there ever going to be a skew ability for Cool basic?"

Making the slant seems like its going to be much more challenging.

Oh and I haven't decided how to put all of this information into a map file...
Aavesoturi
Active Member
Posts: 163
Joined: Fri Aug 31, 2007 7:07 pm
Location: Helsinki
Contact:

Re: 2.5d game

Post by Aavesoturi »

Sorry I can't make heads or tales for your code...
That wasn't actually my code, but Cod3r's.
Basically, ArrayOfInt holds the values to be sorted and iNrOfItems the number of items to sort. The algorithm itself is quite confusing, but as long as it works, it is not necessary to understand it completely ;)
I have recently made a wall. It uses strips of an image to make the skew.
Question "is there ever going to be a skew ability for Cool basic?"
I have actually done the same (used stripes to render walls). Code for that can be found in the old (finnish) forums: http://www.coolbasic.com/oldforums/inde ... st&p=32099
There is also an FPS game called ShadowSquad (by MgZ) that uses similar method: http://www.coolbasic.com/oldforums/inde ... topic=3094

Skewing an image seems to be too time consuming operation for the current cb to be done in real-time. Some tech-demo of the next CoolBasic version featured skewing image, but the timetable for the release of the new version (or its progress) is unclear.
Post Reply