• Axe Q&A 5 5
Currently:  

Author Topic: Axe Q&A  (Read 587140 times)

0 Members and 4 Guests are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Q&A
« Reply #255 on: April 29, 2011, 03:13:31 pm »
Runer, I wish I got anything of what you're doing there. I would like to try it anyway, where should I place it, before or after displaying the sprite?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #256 on: April 29, 2011, 03:14:43 pm »
You would want to have this code execute when your sprite is not currently on screen, so before you draw it. Note that if a collision is detected, this routine would jump to a Lbl COL, so you would need to add this as your collision handler.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Q&A
« Reply #257 on: April 29, 2011, 03:15:44 pm »
I have a new question. How to order things in the loop so that everything works fine?

Code: [Select]
Repeat getKey(15)
...
End

I need to draw the tunnel, draw the sprite, check for collision and shift the screen

Here's the code to draw the sprite:

Code: [Select]
Pt-On(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1

I'm doing this:

Code: [Select]
DRAW TUNNEL
Pt-On(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1
COLLISION
SHIFT SCREEN

Shift Screen = Horizontal - (3 times)

However, it's not working. How should I make it?

I also tried:

Code: [Select]
DRAW TUNNEL
COLLISIONS
SHIFT SCREEN
Pt-On(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1

My problem is handling collisions because of shifting the screen (for example, X collision checking doesn't work because I shift the screen).

So, what order do you recommend?
« Last Edit: April 29, 2011, 05:17:44 pm by Scout »

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Axe Q&A
« Reply #258 on: April 30, 2011, 10:42:28 am »
First, you should try to use only one of Pt-On, Pt-Change, or Pt-Off if possible, as each is a couple hundred bytes in size.
Second, try:
Code: [Select]
DRAW TUNNEL
COLLISIONS
Pt-Change(X,Y,Pic1
DispGraph
Pt-Change(X,Y,Pic1
SHIFT SCREEN
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #259 on: April 30, 2011, 10:20:04 pm »
The problem with your previous code was that you needed to close the parentheses of each pxl-Test. In your code, you were performing the or on the second argument of the pxl-Test, not the result of the pxl-Test.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Axe Q&A
« Reply #260 on: May 01, 2011, 12:28:52 am »
In Axe it's always a good idea to close your parentheses and braces. Leaving them off doesn't save any bytes from the compiled version, and code can become more messy and harder to understand and optimize.

If you're used to the way it is in BASIC, just make sure you close them before an operation that deals with something other than the immediate value.




Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Q&A
« Reply #261 on: May 01, 2011, 05:33:51 am »
:crazy: I actually knew it didn't save any bytes in the compiled version, but didn't know it could affect my code. I'll change it and thanks, thanks thanks so much!

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Re: Axe Q&A
« Reply #262 on: May 13, 2011, 05:33:31 pm »
Why doesn't Text(x,y,"(text)") work?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #263 on: May 13, 2011, 05:35:40 pm »
If that's your exact code, the coordinates are a problem. The lowercase x and y mean nothing to Axe and will generate errors.

If, however, you just forgot to capitalize them in this post, I don't know what the problem is. Can you elaborate on "doesn't work"?
« Last Edit: May 13, 2011, 05:36:24 pm by Runer112 »

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Axe Q&A
« Reply #264 on: May 13, 2011, 05:37:14 pm »
It may also be that he's calling a DispGraph routine and hasn't called Fix 5 yet, which would make it appear to not work.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Re: Axe Q&A
« Reply #265 on: May 13, 2011, 05:38:33 pm »
sorry, in the actual code x and y are numbers
its really Text(20,50,"(text)")

Ashbad

  • Guest
Re: Axe Q&A
« Reply #266 on: May 13, 2011, 05:39:25 pm »
What exactly happens? ;) It's working fine for me on 0.5.1.

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Re: Axe Q&A
« Reply #267 on: May 13, 2011, 05:40:25 pm »
When it compiles it returns an error: argument

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axe Q&A
« Reply #268 on: May 13, 2011, 05:44:55 pm »
Which Text command are you using?  Remember, there are two of them.
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: Axe Q&A
« Reply #269 on: May 13, 2011, 05:45:48 pm »
good point, Happybob ;)

Use the one with the parenthesis right after the Text (it looks like Text( in the catalog, not Text with a space)