Sorry haven't replied, I've been preoccupied with jobs and scholarships

Anyway, by playing with the code, I think I made a breakthrough somewhat. Somehow by changing something I was able to get the gravity working, at the cost of the collision detection(its a little glitchy) here's a screenshot


As you can see, its moving in a parabola pattern, meaning it is working like gravity should. I'm gonna try and compare the changed code with older versions and see what up.

just in case anyone was wondering here is the changed code in its entirety, both x and y collision codes

Code:
Collisions:

    ld      a,(YPOS)
    ld      hl,Velocity+1
    add     a,(hl)
   
    ld      hl,XPOS
    ld      e,(hl)
   
    push    ix
   
    call    FindTile
    call    CheckClearTile
   
    jr      c,SkipYCollision
   
    ld      hl,$0000
    ld      (844Bh),hl
    B_CALL(_DispHL)
    ld      a,(XPOS)
   
    ld      a,(YPOS)
    and     %11111000
   
    ld      hl,Velocity+1
    bit     7,(hl)
    jr      z,skipYadd8
    add     a,8
skipYadd8:
    ld      (YPOS),a
    xor     a
    ld      (Velocity+1),a

SkipYCollision:

    pop     ix
   
    ld      a,(XPOS)
    ld      hl,Velocity
    add     a,(hl)
    ld      (XPOS),a
    ld      e,a
   
    ld      a,(YPOS)
    dec     a
   
    call    FindTile
   
    call    CheckClearTile
   
    jr      c,SkipXCollision
   
    and     %11111000
   
    ld      hl,Velocity
    bit     7,(hl)
    jr      z,skipXadd8
    add     a,8
skipXadd8:
    ld      (XPOS),a
    xor     a
    ld      (Velocity),a
SkipXCollision:
       
    ret


I gonna do something first and then try and knock this out once and for all TODAY.[/code]
Any updates? How's the code coming along?

Btw, do you have a particular project in mind?
chickendude wrote:
Any updates? How's the code coming along?

Btw, do you have a particular project in mind?
All three questions heartily seconded. It seems like the engine is making great progress, so I look forward to seeing what it could be worked into.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement