Author Topic: Axe Programming  (Read 8513 times)

0 Members and 1 Guest are viewing this topic.

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Axe Programming
« on: May 01, 2013, 12:53:48 pm »
Hello Programmers,

I was wondering if anybody could give a descriptive tutorial on how to make a shooting game. I cannot seem to figure out how to make rapid bullet fire and how to make multiple ships move around the screen. Thank You very much for your time and cooperation :)
 

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Programming
« Reply #1 on: May 01, 2013, 01:01:44 pm »
If you know how to handle one object, it is easy to handle several, using a For loop.
For example, to move one pixel from left to right, you do that:
:-1->A
:While 1
:  Pxl-On(A++,0)
:  DispGraph
:End
(yeah, infinite loop, I don't care)

Now, to move 10 pixels from left to right, you do that (unoptimized):
:Fill(L1,10,0)
:While 1
:  For(r1,0,9)
:    Pxl-On({r1+L1}++,r1)
:  End
:  DispGraph
:End

Now, I let you guess what to do with your ships and your bullets ;)
« Last Edit: May 04, 2013, 04:48:10 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: Axe Programming
« Reply #2 on: May 01, 2013, 01:13:04 pm »
If you know how to handle one object, it is easy to handle several, using a For loop.
For example, to move one pixel from left to right, you do that:
:0->A
:While 1
:  Pxl-On(A,0)
:  DispGraph
:End
(yeah, infinite loop, I don't care)
...

I'd go for this:
:0->A
:While 1
:  Pxl-On(A,0)
A+1->A
:  DispGraph
:End

And if you use repeat getKey(15) instaed of While 1, you can quit the loop by pressing clear. But Hayleia has already said the most basic thing: If you know how to do one thing, you can easily do it multiple times by putting it in a for loop.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Axe Programming
« Reply #3 on: May 01, 2013, 01:38:58 pm »
You are asking for a tutorial for making a shooting game. That's about the same as asking us to make a shooting game. You also don't really say what you've got already, I'm sure you have already tried to make things. What are the problems you have? Don't you understand how to code things in Axe, or do you not understand the theory behind a shooter? Once we know where exactly to help you with, we are happy to answer!
Anyways, Deep Thought made a SHMUP (shoot-em-up) tutorial a while back here. Please note that this is written for an older version of Axe so information might not be 100% accurate. I am actually creating a SHMUP for PC right now, so I can also provide you with information.
Last but not least, welcome to Omnimaga, you can introduce yourself here! I hope you enjoy your stay!
I'm not a nerd but I pretend:

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Programming
« Reply #4 on: May 01, 2013, 04:01:48 pm »
If you know how to handle one object, it is easy to handle several, using a For loop.
For example, to move one pixel from left to right, you do that:
:0->A
:While 1
:  Pxl-On(A,0)
:  DispGraph
:End
(yeah, infinite loop, I don't care)
...

I'd go for this:
:0->A
:While 1
:  Pxl-On(A,0)
A+1->A
:  DispGraph
:End

And if you use repeat getKey(15) instaed of While 1, you can quit the loop by pressing clear. But Hayleia has already said the most basic thing: If you know how to do one thing, you can easily do it multiple times by putting it in a for loop.
Lol at first I had a A++ in the EndIf, which also means that my loop was not infinite, but then I wanted to simplify and forgot to put the A++ back -.-
And While 1 / EndIf getKey(15) is more optimized than Repeat getKey(15) / End ;)

(fixed my previous post)
« Last Edit: May 04, 2013, 04:48:30 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: Axe Programming
« Reply #5 on: May 02, 2013, 01:05:01 pm »


Thank You so much for all of the info. I can basically make any game i want to because I am quite familiar with axe.What I really need help is with the things called arrays. I think they are used for bullets in rapid fire. I want to be able to hold down the button with multiple bullets shooting. Can somebody please give me a description on arrays or something? It would really help. Thank you for your warm welcome :) ;D

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Axe Programming
« Reply #6 on: May 02, 2013, 01:51:30 pm »
Well, as everyone in this thread said before me (:P), if you can move one bullet, you can move 100 of them with a For loop. This is where arrays are useful.

The things you call "arrays" don't really exist in Axe, since there aren't any data type nor anything. What's there is plain RAM. But you can easily use it as an array-ish variable.

For example, let's use L1 ([2nd][1]). It's a pointer on a 768 bytes free RAM area, so it should be enough. Although it's in fact a simple area that you can go through using {r1+L1} where r1 goes from 0 to 767, you can also use another technique : use {r2*X+r1+L1}, where r2 goes from 0 to the number of rows minus 1 of your "array", X is the number of colons in your array and r1 goes from 0 to X - 1. Thus, you can pass r1 as the colon of an element of your array, and r2 as the row. And poof, you have an array.
« Last Edit: May 02, 2013, 01:53:22 pm by Matrefeytontias »

Offline alex99

  • LV3 Member (Next: 100)
  • ***
  • Posts: 80
  • Rating: +9/-5
    • View Profile
    • Alexstudious
Re: Axe Programming
« Reply #7 on: May 04, 2013, 02:17:06 pm »
i´ve three questions:
1.can you use the menu( in axe? if yes how?
2.in basic you have sub(str1,...,...).what is this in axe?
3.i want to copy sth to a prog.that that i want to store to a prog is located in a string.when in the string is stored --> tho
en it shall copy: "->".but how you can breake the copy and copy -> and go on whith the copy?
VISIT:

www.atomsoftware.jimdo.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Programming
« Reply #8 on: May 04, 2013, 02:23:55 pm »
1.No, you have to make your menus by yourself and it is not that bad. And the Z-Test command is quite useful for that if you want something that looks like Menu(.
2.Strings are, like any kind of data, handled by pointers, so just add an offset to your pointer. For example, if Text(0,,Str1) displays "wattouat", then Text(0,,Str1+1) displays "attouat" and Text(0,,Str1+2) displays "ttouat".
3.I didn't understand anything to the question
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline alex99

  • LV3 Member (Next: 100)
  • ***
  • Posts: 80
  • Rating: +9/-5
    • View Profile
    • Alexstudious
Re: Axe Programming
« Reply #9 on: May 05, 2013, 06:49:28 am »
thank you i ´m trieing now possibilities for 3.
VISIT:

www.atomsoftware.jimdo.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Offline alex99

  • LV3 Member (Next: 100)
  • ***
  • Posts: 80
  • Rating: +9/-5
    • View Profile
    • Alexstudious
Re: Axe Programming
« Reply #10 on: May 18, 2013, 10:10:40 am »
hey everyone
i´made a pic format for my own progs...
it is stored and executed in basic...
now i´m trying to port it into axe,but the axe prog is ram clearing...
info :
picsprite is stored into str1

prog for executing in basic:

Code: [Select]
:"?º'{^r}!{^T}{dot}{cross}{box},/*-+π{E}{e}{^3}{^2}{^-1}{}():."→Str0
:For(A,1,length(Str1)
:sub(Str1,A,1)→Str2
:inString(Str0,Str2)→B
:A+1→A
:sub(Str1,A,1)→Str2
:inString(Str0,Str2)→C
:Pxl-On(X+B,Y+C)
:End
in axe:
Code: [Select]
:.ASCLPIC
:GetCalc("Str1")→A
:GetCalc("uX")→{X}{^r}
:GetCalc("uY")→{Y}{^r}
:"?º'{^r}!{^T}{dot}{cross}{box},/*-+π{E}{e}{^3}{^2}{^-1}{}():."→Str0
:""→Str4
:length(A)=L
:conj(A,Str4,L)
:For(B,1,length(Str4
:Str4+B→P
:For(C,1,length(Str0)
:If Str0+C=P
:C→Z
:B++
:Str4+B→P
:For(C,1,length(Str0)
:If Str0+C=P
:C→θ
:sub(DW)
:End
:End
:End
:End
:End
:
:Lbl DW
:Pxl-On({X}{^r}+Z,{Y}{^r}+θ
i hope i find some help here...
« Last Edit: May 18, 2013, 10:11:30 am by alex99 »
VISIT:

www.atomsoftware.jimdo.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: Axe Programming
« Reply #11 on: May 18, 2013, 12:15:10 pm »
the first thing I see is in this part of code :

Code: [Select]
GetCalc("uX")→{X}{^r}
GetCalc("uY")→{Y}{^r}

if you do that, then then adresse of the var will store to the ram at x and y adresse
but if you don't define this var, it can do ram clear or data corruption if they are store where there should'nt be store  :P

use this instead :

Code: [Select]
Buff(2)->°X
Buff(2)->°Y
GetCalc("uX")->{°X}^r
GetCalc("uY")->{°Y}^r

this will store the adresse of the os' variable into a defined place locate in the compiled prog

the second thing I see is :

Code: [Select]
length(A)=L

in AXE, this will just do a comparaison. I suppose it should be

Code: [Select]
length(A)->L

And why do you use this :

Code: [Select]
Pxl-On({X}{^r}+Z,{Y}{^r}+θ

because with this code, you do a pxl-on at the pos (adresse os X)+Z,(adresse os Y)+θ
and in fact, why are you using os-vars ? (varX,varY) ? As I know, they don't even have the same format than axe var...

AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline alex99

  • LV3 Member (Next: 100)
  • ***
  • Posts: 80
  • Rating: +9/-5
    • View Profile
    • Alexstudious
Re: Axe Programming
« Reply #12 on: May 18, 2013, 12:21:15 pm »
well i use them because i ´want to make this tool for basic programmers
x and y are pointing the sprite on that part where the basic prog it defines
and str1 is the sprite itself...


Code: [Select]
Buff(2)->°X
Buff(2)->°Y

is not working

axe parser shows
:err:name length  :banghead: :banghead: :banghead:
« Last Edit: May 18, 2013, 12:35:23 pm by alex99 »
VISIT:

www.atomsoftware.jimdo.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Axe Programming
« Reply #13 on: May 18, 2013, 12:52:15 pm »
Just do float{GetCalc("varX")}→X and float{GetCalc("varY")}→Y and then you can use X and Y like normal Axe variables.

Offline alex99

  • LV3 Member (Next: 100)
  • ***
  • Posts: 80
  • Rating: +9/-5
    • View Profile
    • Alexstudious
Re: Axe Programming
« Reply #14 on: May 18, 2013, 01:29:53 pm »
i changed getcalc( like jacobly said and it is every time showing a pxl at 10/60

the ehole prog is not working !!!!!!!!!
i need some help
is there mabey anywhere sth wrong...
or mabey you have another  possibility....
VISIT:

www.atomsoftware.jimdo.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------