Author Topic: [Project] Ahead  (Read 8826 times)

0 Members and 1 Guest are viewing this topic.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [Project] Ahead
« Reply #45 on: December 22, 2010, 06:57:51 pm »
no, i mean what change in the code fixed it?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [Project] Ahead
« Reply #46 on: December 22, 2010, 06:58:32 pm »
what worked?

I can't fly anymore...

I can't double press up in the air, I mean.
If you need to double-press, decrease gravity, or have it start out lower, right after the initial jump and slowly increase.  Also have it only allow two or three jumps in all by having some counter.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [Project] Ahead
« Reply #47 on: December 22, 2010, 07:01:37 pm »
Code: [Select]
Y+1->Y
Gravity is as slow as it can be... Can it be <1?

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [Project] Ahead
« Reply #48 on: December 22, 2010, 07:02:41 pm »
yes. that would be 65024
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [Project] Ahead
« Reply #49 on: December 22, 2010, 07:04:34 pm »
yes. that would be 65024

I found a different way (1/4), in the screenshot.

Now my concern are the X collisions:

Code: [Select]
.Collision test (ground) and Gravity
  !If pxl-Test(X,Y+8)
    Y+(1/4)->Y
  End

  !If pxl-Test(X+7,Y+8)
    Y+1->Y
  End

  If pxl-Test(X+5,Y)
     X-1->X
  End

  If pxl-Test(X-1,Y)
     X-1->X
  End

There are a few bugs when hitting the wall :S

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [Project] Ahead
« Reply #50 on: December 22, 2010, 07:36:37 pm »
ummm.  1/4 shouldn't work.  That would be 0.
0.25 is truncated to 0
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [Project] Ahead
« Reply #51 on: December 22, 2010, 07:56:43 pm »
ummm.  1/4 shouldn't work.  That would be 0.
0.25 is truncated to 0


But it worked :)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [Project] Ahead
« Reply #52 on: December 22, 2010, 08:02:48 pm »
you can double all you y values and then display y/2
i am trying to say to use proportions.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Ashbad

  • Guest
Re: [Project] Ahead
« Reply #53 on: December 22, 2010, 08:06:25 pm »
And, he's right, that would return 0 there scout.  It shouldn't be working.  Wonder what's happening.  Unless Y is being incremented later on in the program...

Either way nice work so far scout!  Later on I can teach you how to use a Matrix appvar like in pyyrix (Technically a 2D array, but I'm used to calling them matrices and my friends think I'm crazy :)) And how to add smoothscroll using state of the art position-modulated routines (fancy name I gave them due to the fact they rely heavily on moduli (plural of modulus))





;)


Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: [Project] Ahead
« Reply #54 on: December 22, 2010, 09:43:39 pm »
Axe is an Integer system, I think it has something to do with your guy appearing there instantly.  ;)
as for the wall, use
Code: [Select]
:If pxl-test(X+8,Y)
:X-1->X
:End
that should work unless your incrementing the X by more than 1.
otherwise you could include it in your getkey codes.  as for double jumping, if you did what I suggested and have a J var for whether you're jmping or not, do this:
where J is 0 for on ground or falling, J is 1 for jumping
Code: [Select]
:If J and (getkey(1))
:Y-1->Y
:End

with a timer, that is.  ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

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: [Project] Ahead
« Reply #55 on: December 23, 2010, 12:17:59 am »
ANother thing: It might be nice if movement wasn't too fast either. Maybe add A Pause command to slow things down?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [Project] Ahead
« Reply #56 on: December 23, 2010, 05:28:32 am »
Code: [Select]
:If pxl-test(X+8,Y)
:X-1->X
:End

That will only work if I change the sprite to this:

Code: [Select]
0E040E15040A0A0A
Which I've already done.

Code: [Select]
:If J and (getkey(1))
:Y-1->Y
:End

I tried something similar to do this, maybe it didn't work because I don't have the correct code for J:

Code: [Select]
If pxl-Test(X,Y+8)=0
1->J
Else
0->J
End

However, I do believe that is OK, and will try it once again and then post a new screenshot.