Author Topic: ninja warrior  (Read 4080 times)

0 Members and 1 Guest are viewing this topic.

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
ninja warrior
« on: December 30, 2007, 06:15:00 pm »
well, i have been having an on again off again relationship with this game for about 2 years now. a while ago i found elfprince's 2d sidescroling engine and i basically overhauled it so that instead of emulating a 2d sidescolling engine, it actually is a 2d sidescrolling engine. basically his game stuck on 7th rank, you could move left and right regaurdless of what is on the level in your way and when you jumped it would move you up, then back down to the 7th rank. i took it and made it so that you can land on stuff, collision detection, actual jumping, ability to leave screen above, extra high jump for certain tiles... in short i made it usable for anyone wanting to make a game. im gona re release this in a bit as a fully fledged game but im gona release a "beta" now because if i dont im never gona let this progress. this beta includes the engine "sidescro", a level editor "lvled" a few levels "levels" and a blank level with which to start your level editing "newstr" these are all programs and i will explain each.

Sidescro
the basic engine uses a string for a level, your a little n that you move around jumping and stuff. left right and up are movement. (move left, right and jump) this program requires xlib so that you can jump horizontally. the controlls suck which is another thing that i will atempt to remedy in a future version. anyhelp in this area would be nice, all my efforts have been failures.

leveled, this is a basic level editor, make sure there is a level in str1 by running newstr or pulling a level out of levels. move around and press y= to chose why symbol to put in, i think 2nd is put in, and alpha erasses,

levels:
this is like a level pack, since this is where the levels are at run it and press0, . or - maybe 1 and 2 are also viable options. it will send the level to the string and give you a message saying you ahve succesffully created a syntax error due to my half-assing of this part or the beta.

newstr: run it and it clears str1..well it sets the dimension of str1 to the necessary length to put into leveled or the engine. engine wont work without correct amount of stuff in the string, well it may, but not well.

Other things. i feel bad that i asked for your help above, i really need it but i fear that i am sending you into an abyss of terribly complex code. i use finance vars as well as exceedingly long logic structures with no documentation. this may change later on. also this version does not have the ability to jump real high on certain tiles like i had said before. i think i have the version on sourcecoder over at cemetech but the fact that it doesnt handle finance vars with any level of success means that it may be a while before i can get that version ready for download. also, this is a group file, idk how that'll work for you 83ers but if you know it wont work and know how it will work for you guys, ill certainly do it.

any suggestions are welcome,  use the code if you want idk how your supsed to handle credit when i modified some elses thing but ill probably find out before it matters anyway.

also, this is not me putting everything neetly together to show to the world finnaly, this is me trying to force myself to man up and work on this. there should be progress and i apologize for the massive intro of text.

try it out, enjoy it. there are different ways to beat the levels, im planning on making that important in some way later on. good luck

newfile:

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
ninja warrior
« Reply #1 on: December 30, 2007, 07:13:00 pm »
this reminds me the game you showed me a while ago. It was nice and fast for scrolling, but this one seems to have a problem, it keeps jumping and going right and I didn't pressed any buttons o.oblink.gif

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
ninja warrior
« Reply #2 on: December 30, 2007, 08:53:00 pm »
do you have xlib enabled? it will go right and jump if not due to key detection stuff. it works perfect on my calc. my msg was a bit confusing but the version i have up now needs xlib. thats another thing i need to do, xlib detection...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
ninja warrior
« Reply #3 on: December 31, 2007, 09:38:00 am »
oops forgot about xlib, thanks x.x I didnt expected it required xlib since it's all ASCII character based sprites

Btw I love the level you can get to by pressing . and - in prgmLEVEL

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
ninja warrior
« Reply #4 on: December 31, 2007, 10:08:00 am »
Trying quickly on the TI Flash Debugger, 83+SE (I can't transfer right now, my calc has low batteries >_<), it looks interesting, minus the sucky coding ;)wink.gif
I think I'll put it on my calc for real once I get the batteries recharged.
(EDIT: Not rechargable batteries >_<)
One of these days I'll get a sig I'm really proud of.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
ninja warrior
« Reply #5 on: December 31, 2007, 10:24:00 am »
for some reasons i found the coding to be fine. it even ran twice faster than ROL world map

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
ninja warrior
« Reply #6 on: December 31, 2007, 10:55:00 am »
It was fast for sure (on an emulator); but syntax errors, no built-in xLib prompt, and general confusion isn't good.
But on the bright side... I just got new batteries :Ptongue.gif
One of these days I'll get a sig I'm really proud of.

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
ninja warrior
« Reply #7 on: December 31, 2007, 11:20:00 am »
well heres a new update, file in first post. this group includes a commented version that runs slow as hell but is decently documented. i removed the syntax errors of the levels program as well. im gona post the engine code here to see if anyone can optimize. this version doesnt use f-vars. also, consider that a challenge, i really dont think anything will be found in the way of optimization, but then again... im very sure i could be wrong. edit: yup, wrong

c1-->
CODE
ec1:ClrHome
:0→P
:2→N:1→I
:24→T
:0→F
:Repeat PN=570 or I=8
:real(8)
:Ans→T
:F+(I≥0)6/(2-(sub(Str1,54abs(I)+N+P,1)="U"))(max(T={4,7,8}))not(F)(sub(Str1,54abs(I)+N+P,1)≠" →F
:If I≥1:Then
:sub(Str1,54I-53+N+P,1)=" →D
:sub(Str1,54I-55+N+P,1)=" →E
:Else
:1→D
:1→E
:End
:P+(P≠38 and DN=12 and max(T={3,6,8→P
:N-(max(T={2,5,7}) and EN>1)+(max(DT={3,6,8}) and ((P=38 and N<15) or N<12→N
:F(I≤1)+F(I>1)(sub(Str1,54abs(I)+N+P-108(I>1),1)=" →F
:I+(I<0)+not(F)(sub(Str1,54abs(I)+N+P,1)=" ")(I≥0)-not(not(F→I
:F-not(not(F→F
:Output(1,1,sub(Str1,1+P,16)+sub(Str1,55+P,16)+sub(Str1,109+P,16)+sub(Str1,163+P,16)+sub(Str1,217+P,16)+sub(Str1,271+P,16)+sub(Str1,325+P,16)+sub(Str1,379+P,16
:If 3.5≥abs(4.5-I:Then
:Output(I,N,"N
:End
:End
:Return
c2
ec2

variable explanantions: P-x value of screen in teh whole map
N- x value of ninja in the screen
I- y value of ninja in screen
F- momentum in the y direction. this variable changes when you jump. if tthis value is 3 then you will move up 3 spaces during the next 3 frames unless you hit something above you.
T-holds keypress

anybugs you notice or optimizations are appreciated. and being that this is a bare bones engine, xlib detection is not gona ever be in it. it will be in an overlying program that calls the engine later on. the code isnt that bad now that ive looked over it, the only thing is that this is probably the fourth version of the code. ive goten optimization ideas 3 times that ive applied to the entire program so some of the functions of code sequences may be a bit hard to understand but i think i explained it all in the commen program.

also if you want to compare source coder code to the calculator code:
P=PV
N=N
I=I%
T=PMT
F=FV

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
ninja warrior
« Reply #8 on: December 31, 2007, 11:24:00 am »
c1-->
CODE
ec1:(sub(Str1,54I-53+N+P,1)=" →D
:(sub(Str1,54I-55+N+P,1)=" →Ec2
ec2
I might be mistaken, but on these two lines you could remove the opening parenthesis. Why are they even there?

EDIT:c1
-->
CODE
ec1:P+(P≠38 and DN=12 and max(T={3,6,8→Pc2
ec2
Reordering FTL- of two bytes :Ptongue.gif
One of these days I'll get a sig I'm really proud of.

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
ninja warrior
« Reply #9 on: December 31, 2007, 11:34:00 am »
QuoteBegin-Radical Pi+31 Dec, 2007, 17:24-->
QUOTE (Radical Pi @ 31 Dec, 2007, 17:24)
c1-->
CODE
ec1:(sub(Str1,54I-53+N+P,1)=" →D
:(sub(Str1,54I-55+N+P,1)=" →Ec2
ec2
I might be mistaken, but on these two lines you could remove the opening parenthesis. Why are they even there?

EDIT:c1
-->
CODE
ec1:P+(P≠38 and DN=12 and max(T={3,6,8→Pc2
ec2
Reordering FTL- of two bytes :Ptongue.gif

 yup, i was wrong. but i coulda sworn those parenthesis were necessary...i thought that to make an = opration into a binary value, you needed parenthesis. i tested it and it still works

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
ninja warrior
« Reply #10 on: December 31, 2007, 11:36:00 am »
= operations, and all other 'tests' for that matter, always produce a binary result.
One of these days I'll get a sig I'm really proud of.

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
ninja warrior
« Reply #11 on: December 31, 2007, 11:42:00 am »
QuoteBegin-Radical Pi+31 Dec, 2007, 17:36-->
QUOTE (Radical Pi @ 31 Dec, 2007, 17:36)
= operations, and all other 'tests' for that matter, always produce a binary result.

i probably did something dumb like E=3 + E->E (supposed to mean (E=3)+E->E) at one point, misinterpreted the result, and then never questioned it...

like here: I+(I<0)+not(F)(sub(Str1,54abs(I)+N+P,1)=" ")(I≥0)-not(not(F→I

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
ninja warrior
« Reply #12 on: December 31, 2007, 11:47:00 am »
That's just order of operations. Parentheses do stuff (gosh, I sound smart...)
I remember making the same mistake at one point though, so eh...
One of these days I'll get a sig I'm really proud of.

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
ninja warrior
« Reply #13 on: December 31, 2007, 11:58:00 am »
now that the code is layed out do you understand it all? i can see it easier but then ive been working on it for a long time so i already knew the gist of the code. is the layout + comments on calc making it easier/seeable or do i need to be more indepth with my comments?

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
ninja warrior
« Reply #14 on: December 31, 2007, 12:20:00 pm »
I didn't give a genuine effort to understand it yet. I will now then.
One of these days I'll get a sig I'm really proud of.