Author Topic: [Basic] SkyBox2D Homescreen Engine  (Read 4257 times)

0 Members and 1 Guest are viewing this topic.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
[Basic] SkyBox2D Homescreen Engine
« on: July 21, 2010, 06:20:14 pm »
Well here is a complete suprise release. Sometimes when you have alot of free time (like now) and have some old unfinished projects laying around then sometimes you suddenly finish it.

The engine surely uses a very slow method (matrix based worlds) but I already figured a map compression technique that should ease the pain of the massive size of matrices (not implented in source below). Second, this engine was mostly intended to be used by the beginners in Basic who just want to create a game and not having to go through the process of creating collision detection, movement etc. So here it is! SkyBox2D V1.0!

Code: [Select]
prgmSKYBOX2D
ClrHome
1->L
"_NP[-]+I=*->Str0
prgmSBLEVELS
For(A,1,16
For(B,1,8
Output(B,A,sub(Str0,[A](B,A),1
End
End
2->X:2->Y
Lbl SB
0->K
While not(sum({24,25,26,34}=K
getKey->K
End
X->C:Y->D
X+(K=26)-(K=24->X
Y+(K=34)-(K=25->Y
If sum({4,5,6,7,8,9}=[A](Y,X  // every number in this list is a tile number that is collidable. The next and previous level tiles are non-collidable tiles and are thus left out of this list
Then
C->X:D->Y
End
Output(Y,X,"M
Output(Y-(K=34)+(K=25),X-(K=26)+(K=24),sub(Str0,([A](Y-(K=34)+(K=25),X-(K=26)+(K=24))),1
If [A](Y,X) = 2 or [A](Y,X)=3
Then
L+([A](Y,X)=2)-([A](Y,X)=3)
prgmSBLEVELS
For(A,1,16
For(B,1,8
Output(B,A,sub(Str0,[A](B,A),1
End
End
Goto SB

This code manages five things.
1. It draws the Map that is in [A].
2. It moves and displays the main character (the letter M in this example)
3. It does collision detection
4. It handles going to the next or previous level depending on the tile you step on (tile #2= next level, tile #3 = previous level)
5. It leaves no traces of moving the main characters around. It just copies the previous tile you were on to its original location.

Levels are set up as follows. Create a prgm called SBLEVELS (or name it otherwise in the source above) and insert the matrices. All matrices are 8x16 in size. Every element in the matrix represents a tile at that location. So [A](1,1) = 1 means that the tile pointed to by number 1 is drawn at position 1,1 on the homescreen.
L increments by one if you step on a next level tile and decrements by one if you step on a previous level tile, Therefor this could be level code:
Code: [Select]
If L=1
Then
If not(LDATA(L
Then
1->LDATA(L
Pause "You are in level 1 atm and I wont say it again!"
End
[[....
.....
...
....
]]->A
End
If L=2
Then
If not(LDATA(L
Then
1->LDATA(L
Pause "You are in level 2 atm. This message is only displayed once"
End
[[....
.....
...
....
]]->A
End

IMPORTANT this post is incomplete but I am running out of time and on the other hand couldn't keep my excitement about this engine. I promise to provide additional (required information) as soon as possible.
« Last Edit: July 22, 2010, 10:31:36 am by matthias1992 »
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: [Basic] SkyBox2D Homescreen Engine
« Reply #1 on: July 21, 2010, 06:42:29 pm »
Sounds cool! I myself will never use it, but this could be very helpful.
Can't wait for more details! :D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Basic] SkyBox2D Homescreen Engine
« Reply #2 on: July 21, 2010, 07:39:12 pm »
mhmm I am curious what it is. I don't feel like typing the entire code in my calc (the format is not SourceCoder) or in an emu atm x.x. I can't wait to see more details about this project.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: [Basic] SkyBox2D Homescreen Engine
« Reply #3 on: July 22, 2010, 08:54:36 am »
Yea, as I said it is more intended for people who are yet not confident enough in BASIC to do all this...
I Will eventually, if I have provided all the information, post the .8xp file. I just have tons of projects running in parallel...

Any updates will be added to the first post.
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: [Basic] SkyBox2D Homescreen Engine
« Reply #4 on: July 22, 2010, 09:05:54 am »
Cool. I'll give it a try if you'll give us some documentation :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Basic] SkyBox2D Homescreen Engine
« Reply #5 on: July 29, 2010, 01:19:46 am »
Cool, I can't wait to see how it is ^^