Author Topic: Grappler!  (Read 30504 times)

0 Members and 4 Guests are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #15 on: November 25, 2011, 04:27:57 pm »
* epic7 wishes he knew what that meant (@builderboy)

In zedd, do you store sprite stuff to Str0SP? And how would I add that with AddZ and then display it?

@nick I think that's exactly what I did. I posted my code in a topic n the axe forum.i
« Last Edit: November 25, 2011, 04:31:59 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #16 on: November 25, 2011, 04:46:10 pm »
Basically the same thing Nick said XD keep doing pixel tests at a 45 degree angle moving away from the player until you find a wall.  And yes sprite information is stored in Str0SP. 

To add an object into the game, simply execute AddZ(X,Y,Width,Height,Mass,Sprite #) where your sprite number is the sprite found in Str0SP.  0 would refer to the first sprite in Str0SP, 1 would refer to the second and so on.  To display and simulate everything, simple run SimZ(), which will run the simulation for 1 frame, and draw all of your objects onto the screen.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #17 on: November 25, 2011, 04:48:56 pm »
Is this all said in the readme?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #18 on: November 25, 2011, 04:51:11 pm »
Indeed, the documentation is quite extensive.  There is also a list of functions that Zedd provides in Functions.txt

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Untitled Grappling Hook Game (for now)
« Reply #19 on: November 25, 2011, 04:52:52 pm »
And Zedd won't send to my calc >:(
« Last Edit: November 25, 2011, 04:53:00 pm by aeTIos »
I'm not a nerd but I pretend:

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #20 on: November 25, 2011, 04:53:49 pm »
D: What kind of errors does it give you?  It's just a basic source program, so it shouldn't have anything special qualities to it x.x

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Untitled Grappling Hook Game (for now)
« Reply #21 on: November 25, 2011, 04:56:14 pm »
The sending thing just freezes. (I use TiLP, might try *cough* TI-Connect *cough*)
I'm not a nerd but I pretend:

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
Re: Untitled Grappling Hook Game (for now)
« Reply #22 on: November 25, 2011, 04:57:45 pm »
This looks pretty great. Will you release the source of the grappling hook routine when finished because maybe someone could eventually use it if he ever makes a Metroid game with the grappling hook item. :P

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #23 on: November 25, 2011, 05:06:03 pm »
Error recieved = Undefined
Goes to = CLZ()
Code for my failed zedd program:

.ZTEST
L1->GDB0OB
L4->GDB0VR
4->GDB0FR
LoadZ(0,15)
10->X
10->Y
[FFFFFFFFFFFFFFFF]->Str0SP
AddZ(10,10,8,8,10,0)
Repeat getKey(15)
ClrDraw
SimZ()
DispGraph
End
Return
prgmZEDD
Lbl CallZ
If S>48
A--
Else
A++
End
Return

Code for my grappling program:
Code: [Select]
:.AAHOOK
:DiagnosticOff
:[1028103854382828]➔Pic1
:[102A123C50B82828]
:[FFFFFFFFFFFFFFFF]➔Pic2
:1➔R➔X−1➔H➔Q➔B➔P
:48➔Y
:Fix 5
:Repeat getKey(15)
:Lbl 1
:ClrDraw
:If X<<1 ;Needs boundaries for now
:1➔X
:End
:If X>88
:88➔X
:End
:If (H=0) or (H=1) ;H is pretty much the status of the player while grappling
:If getKey(3)
:X++
:If H=1
:S++ ;increases rope top X coord. Will explain later
:End
:1➔R
:End
:If getKey(2)
:X−−
:If H=1
:S−−
:End
:0➔R
:End
:End
:If H=1 or H>40
:If getKey(2)
:0➔R
:End
:If getKey(3)
:1➔R
:End
:End
:For(A,0,11)
:Pt-On(A∗8,1,Pic2
:Pt-On(A∗8,56,Pic2)
:End
:If (getKey(54))∗((H=0)+(H>40))∗(B=0) ;Checks if ready to grapple
:X➔S
:Y➔T
:R➔θ
:Repeat pxl-Test(S,T) ;S and T are the top rope coords
:T−−
:If θ
:S++
:Else
:S−−
:End
:End ;That went at a 45 angle to find the ceiling
:If Y=48 ;Checks if on ground and makes it jump if not
:1➔H
:Else
:2➔H
:End
:End
:If H=1
:Y−− ;While jumping, the player can change direction. In the beggining getkeys, I made it change S to preserve the 45 degree angle.
:If Y≤28 ;I should actually put the pxl-test part after the jump so that the moving of s is unneccesary.
:2➔H
:End
:End
:If H>1
:If H≤40
:1➔P
:Line(X+7,Y,S,T) ;Line draw
:Else
:0➔P
:End
:If H<20 ;Here down checks the status of the player and adds or subtracts from the coordinates
:Y++
:If θ
:X++
:Else
:X−−
:End
:H++
:If Y=48
:0➔H➔P➔S➔T
:10➔B
:End
:End
:If H≥20 and (H≤40)
:If θ
:X++
:Else
:X−−
:End
:Y−−
:If Y<9
:56➔H
:0➔P
:End
:H++
:End
:!If H≤40
:If H≤52
:H++
:If θ
:X++
:Else
:X−−
:End
:If Y<9 ;Abort if the guy touches the ground
:56➔H
:0➔P
:End
:Y−−
:ElseIf (H≥52)∗(H≤55)
:H++
:If θ
:X++
:Else
:X−−
:End
:End
:If H>55
:If Y<48
:Y++ ;Fall to the ground after the grappling is done!
:If θ
:X++
:Else
:X−−
:End
:Else ;Resets after hitting the ground
:0➔H➔S➔T
:End
:End
:End
:End
:Pt-On(X,Y,P∗8+Pic1)
:If B
:B−−
:End
:DispGraph
:End
With a varied ground, I'll probably use more pxl-tests rather then checking the y coordinates
« Last Edit: November 25, 2011, 05:08:54 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #24 on: November 25, 2011, 05:12:49 pm »
Oh whoops, rename CallZ to CLZ instead, seems I was mixing syntax x.x Bwt, what is the callback function for?  It looks like it accelerates you left if you are on the right side of the screen, and right if you are on the left side of the screen?

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #25 on: November 25, 2011, 05:13:58 pm »
Its a test program. I figured you'd know since it was the example you put in the readme :P

Problem list:
1. GDB error- fixed
2. GDB error- fixed
3. Sprite error- fixed
4. AddZ error- fixed
5. CLZ error- fixed
6. GDB error- Unfixed- Goes to GDB0WD
« Last Edit: November 25, 2011, 05:17:08 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #26 on: November 25, 2011, 05:16:44 pm »
Ahhh I see, I thought that was your actual code XD Yeah it looks like the documentation goes both ways on the Callback function, just remember to name it CLZ() instead of CallZ()

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #27 on: November 25, 2011, 05:42:01 pm »
See anything else wrong?
Now axe takes me to where it mentions GDB0WD

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #28 on: November 25, 2011, 05:59:08 pm »
Oh i believe you need to define GDB0WD as the width of your tilemap in sprites

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Untitled Grappling Hook Game (for now)
« Reply #29 on: November 25, 2011, 05:59:57 pm »
I'm not using a tilemap in that program

I put 96 in that and then put 1 in gdb0tm since I didnt know what to put. Now, I get no errors but the spe doesn't move.
« Last Edit: November 25, 2011, 06:06:43 pm by epic7 »