Author Topic: Level creating?  (Read 9589 times)

0 Members and 1 Guest are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Level creating?
« on: November 10, 2010, 07:38:15 am »
Hello omnicommunity,

As most of you know, I am working on a side-scroller game. It is progressing nicely, but I have issues level creating.
I currently have this code:

Code: [Select]
0=>C
0=>A

A=time
C=Position in string of next object)

 
data(1,10)=>Str1   (when to occur)
data(1,52)=>Str2   (Where to occur (ypos)
Lbl1
If A={Str1+C}
{Str2+C}=>{L1+2+(2*{L1+0})}      Ypos    {L1+0}= how many objects now?
95=>{L1+1+(2*{L1+0})}       Xpos
{L1+0}+1=>{L1+0}       amount of objects +1
C+1=>C
End
(move object)
For(B,0,({L1+0}*2)
!If {L1+1+B}=0
Pt-Off({L1+1+B},{L1+2+B},[object]
Pt-Off(({L1+1+B}+1),({L1+2+B}),[same object]
{L1+1+B}-1=>{L1+1+B}
{L1+2+B}=>{L1+2+B}      [included for optional vertical moving]
Pt-On({L1+1+B},{L1+2+B},[object]
End
If {L1+2+B}<3

(Now, I dont know how to let the objects dissapear)

Plz help me with the rest of the code... else I cant continue my project :(

Thanx,
aeTIos

P.S. Optimization is welcome too.
« Last Edit: November 10, 2010, 10:30:29 am by aeTIos »
I'm not a nerd but I pretend:

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Level creating?
« Reply #1 on: November 10, 2010, 08:06:48 am »
I probably can't help much but it might help others if you tell us what is happening and what it is supposed to do exactly.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Level creating?
« Reply #2 on: November 10, 2010, 09:22:05 am »
the code is not complete, there is a part missing that:
-has to let the object being disappeared if x<3 so X=1,2
-it should make that the other objects stay displayed, and the data position of their data in L1 should be moved forward if a object disappears, such as
Code: [Select]
For(A,1,{L1+0}
{L1+1+A+2}=>{L1+1+A}
A+1=>A
End
But that doesnt work, then all objects disappear :(

If you know a solution, plz post the code



I'm not a nerd but I pretend:

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Level creating?
« Reply #3 on: November 10, 2010, 11:42:33 am »
Is the goal to make the object invisible or to eliminate it entirely? If it's the former, then you could have a second array with values corresponding to each of the objects. Each element would have a 0 if visible and a 1 if invisible. You then simply erase the object once and flip the bit. Your display routine should then know to not display objects with a 1 bit.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Level creating?
« Reply #4 on: November 10, 2010, 12:25:48 pm »
It is goal to eliminate it
I'm not a nerd but I pretend:

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Level creating?
« Reply #5 on: November 10, 2010, 08:09:32 pm »
To move data around when its not just a byte or 16-bit entry, you have to use Copy().  I used this a lot in the starship example program for the lists of enemies and bullets.  Basically the way I deleted an element in the array was to copy the last element over the current one and then shrink the size variable by 1.

I should probably write an array library for this to make it easier.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Level creating?
« Reply #6 on: November 10, 2010, 08:12:49 pm »
Arrays sound awesome for Axe. By the way, when Axioms get re-enabled, will they use the same format?

And aeTIos, yeah, use Copy(. It's a lot faster and smaller :)




Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Level creating?
« Reply #7 on: November 11, 2010, 02:49:42 am »
kk, I'll try...
I'm not a nerd but I pretend:

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Level creating?
« Reply #8 on: November 11, 2010, 12:30:05 pm »
I tried using Copy(, but it didnt work...

attached a group with the source (SHIP,METEOR,SPIMPSRC) and the game. (lose)
METEOR is the program where the problem is located.
plz help,
aeTIos
I'm not a nerd but I pretend:

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Level creating?
« Reply #9 on: November 11, 2010, 07:16:07 pm »
The group is corrupted. What software do you use to create those files? Don't use Wabbitemu export function because it's buggy.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Level creating?
« Reply #10 on: November 12, 2010, 07:56:54 am »
I used Wabbit, yes, but if I download and ungroup it, the files are *not* corrupted. maybe you should open it with Wabbit and export them then?
I'm not a nerd but I pretend:

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Level creating?
« Reply #11 on: November 12, 2010, 09:36:14 am »
Hmm... Wabbitemu group support changed. It used to just ungroup stuff as you sent them, but now it doesn't anymore, and you absolutely have to send it to archive to get it to work. If sent to RAM it will not work.

And SourceCoder cannot open the file.

Anyway got it to work in the latest version of Wabbitemu. Send to archive, ungroup, done.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Level creating?
« Reply #12 on: November 12, 2010, 10:37:18 am »
Hmm... Wabbitemu group support changed. It used to just ungroup stuff as you sent them, but now it doesn't anymore, and you absolutely have to send it to archive to get it to work. If sent to RAM it will not work.

And SourceCoder cannot open the file.

Anyway got it to work in the latest version of Wabbitemu. Send to archive, ungroup, done.

How you open files with SourceCoder, I thought it would only CREATE files???

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Level creating?
« Reply #13 on: November 12, 2010, 01:16:06 pm »
Hmm... Wabbitemu group support changed. It used to just ungroup stuff as you sent them, but now it doesn't anymore, and you absolutely have to send it to archive to get it to work. If sent to RAM it will not work.

And SourceCoder cannot open the file.

Anyway got it to work in the latest version of Wabbitemu. Send to archive, ungroup, done.

How you open files with SourceCoder, I thought it would only CREATE files???

http://sc.cemetech.net/

There's an upload button ;)

You can also save, edit, and share projects (if you're logged in).

I used Wabbit, yes, but if I download and ungroup it, the files are *not* corrupted. maybe you should open it with Wabbit and export them then?

The export feature is broken right now. Any programs you export will be corrupted, so I'd advise against doing that...

Apparently BuckeyeDude's already fixed the issue, but he's found other bugs, so you'll have to wait for a new version.




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Level creating?
« Reply #14 on: November 12, 2010, 04:12:10 pm »
I think SourceCoder can also convert images, now.