Author Topic: Arrays and misc. Axe help  (Read 2977 times)

0 Members and 1 Guest are viewing this topic.

Offline gcolella

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +9/-0
    • View Profile
Arrays and misc. Axe help
« on: March 16, 2011, 08:25:13 pm »
I just took up axe today, and I've been reading the (awesome) tutorials by Deep Thought. The major part I can't understand is how to use arrays. I'd like to use them to make a test game where you avoid incoming objects, but as many times as I read it I can't seem to get it. Can anyone help me out?

Unrelated: Does anyone have a list of cool hex sprites? It'd make it a lot easier because atm I can't download the sprite creating program that came with axe.

Thanks in advance,
GDC

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: Arrays and misc. Axe help
« Reply #1 on: March 16, 2011, 09:53:22 pm »
could you post your source here?
also welcome.  ;)

as for sprites, you can make them using paint and then convert them using Cemetech's SourceCoder: http://www.cemetech.net/projects/basicelite/sourcecoder2.php

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 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: Arrays and misc. Axe help
« Reply #2 on: March 17, 2011, 09:33:52 am »
I just took up axe today, and I've been reading the (awesome) tutorials by Deep Thought. The major part I can't understand is how to use arrays. I'd like to use them to make a test game where you avoid incoming objects, but as many times as I read it I can't seem to get it. Can anyone help me out?

Glad I made something useful! :D Anyway, what do you need help with?

Just remember that arrays are only for things that appear many times on your screen (like bullets, enemies, etc.). When you add your own ship to the screen, you should store its X and Y values in actual variables, such as X and Y. Then use a For( loop to go through each element in the array and test to see if they hit the ship.

Guess I should finish up that SHMUP tutorial sometime. Enemies and hit detection come next :)




Offline gcolella

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +9/-0
    • View Profile
Re: Arrays and misc. Axe help
« Reply #3 on: March 17, 2011, 03:57:07 pm »
I can't wait to see the enemies and hit detection, it would help a TON with the stuff I'm trying to do.
I finished up the source and it seems to work, even though it's really rudimentary, but I had thought arrays would be nice to use for the 'enemy' sprites you have to avoid, as they were so easy and user-friendly in python. I haven't gotten TiLP to work yet on this linux machine, so I can't upload the files, but I can try to type them up if you think it'd help. Again, the hit detection tutorial would be really really great to read, axe is still pretty perplexing.

PS: I originally found the tutorials at http://clrhome.co.cc/ , nice web presence deep thought :)

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: Arrays and misc. Axe help
« Reply #4 on: March 17, 2011, 09:10:32 pm »
I finished up the source and it seems to work, even though it's really rudimentary, but I had thought arrays would be nice to use for the 'enemy' sprites you have to avoid, as they were so easy and user-friendly in python.

Yeah, in Axe you always get to deal with the bytes directly :D So does it work now? Just ask if you need anything cleared up.

As for my tutorial, it'll probably be a few days before I can work on it again. I'm making some huge changes to my site, and that's been keeping me busy.




Offline gcolella

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +9/-0
    • View Profile
Re: Arrays and misc. Axe help
« Reply #5 on: March 17, 2011, 09:17:58 pm »
It works, but it's very BASIC-esque, and uses variables for everything, no pointers or anything.
One other thing I don't understand, what happens when you use sto in an expression in Axe?