Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Matrefeytontias on August 08, 2012, 08:25:28 pm

Title: [Axe] Gravity Walls
Post by: Matrefeytontias on August 08, 2012, 08:25:28 pm
Hi guys !

Here is my current Axe project : Gravity Walls !

In this gravity-based game, you are a man trapped in a room with only one chance to escape : a small door.

But there is a problem ... this door is sticked far on the wall ! Yeah, this room is kind of special ... In the background, there are arrows, and these arrows decide where go the gravity ; if you go on them, the gravity switch in the direction of the arrow. And since you follow the gravity, you can access to the door by using these arrows !

There will be many levels, but for now I only did the map engine and the physics, and separately.

Mapper :
(http://mattias.refeyton.fr/espace-ti/gravityWalls/mapEngine.gif)

Physics :
(http://mattias.refeyton.fr/espace-ti/gravityWalls/physics.gif)
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 09, 2012, 05:43:44 am
Up !

Now with screenshots !
Title: Re: [Axe] Gravity Walls
Post by: Hayleia on August 09, 2012, 05:52:53 am
Are you a big fan of Leafy ? It reminds me a lot of Graviter (by Leafy) in which the player would control the character from Tag (by Leafy too) O.O
Otherwise, it seems like a great project :D
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 09, 2012, 06:01:40 am
Eeeeeer no I'm not :D but it's right that I took the character from Graviter and Portal X.
Title: Re: [Axe] Gravity Walls
Post by: leafy on August 09, 2012, 09:39:39 am
It does indeed sound like quite the awesome project ^^ I'm glad to see the gravity games getting a revival :P
Title: Re: [Axe] Gravity Walls
Post by: V1mes on August 09, 2012, 10:20:47 am
Cool idea  :D
Can't wait see this one finished
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 09, 2012, 10:23:16 am
How do you get the "scrolling arrows effect" ?
Title: Re: [Axe] Gravity Walls
Post by: Eiyeron on August 09, 2012, 10:27:08 am
Idea: make two same sprites, and in a loop:
Code: [Select]
0->I
[xxx]->Pic0
[xxx]
.the two sprites are the same!!
While(xxx)
I=I+1%8
Pt-On(0,0,Pic0+I)
End
I is used like a offset ;)
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 09, 2012, 10:29:30 am
ah ok , thank's a lot
Title: Re: [Axe] Gravity Walls
Post by: Eiyeron on August 09, 2012, 10:30:59 am
I ust added something, you just have to make two same sprites
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 09, 2012, 10:35:30 am
Well, in fact I use an Axiom I codded for this game :P it's just bits and bytes manipulations in the arrows' image. I did it in ASM to have fast commands.
Title: Re: [Axe] Gravity Walls
Post by: Eiyeron on August 09, 2012, 10:41:14 am
May we take a look at it's source? THat could be VERY useful!
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 09, 2012, 10:41:32 am
I ust added something, you just have to make two same sprites
Yeah I guessed
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 09, 2012, 10:55:25 am
May we take a look at it's source? THat could be VERY useful!
Of course :)

Here are the file axmwalls.z80 :
Code: [Select]
.dw $C0DE
; Scroll down
.dw scrlDEnd
.db 00111111b
.db 0FEh, 0
.db 0
.db 1
rorg 0
ld e, 7
ld d, 0
add hl, de
ld e, (hl)
ld b, 7
LoopD:
dec hl
ld a, (hl)
inc hl
ld (hl), a
dec hl
djnz LoopD
ld a, e
ld (hl), a
scrlDEnd:
; Scroll left
.dw scrlLEnd
.db 00111111b
.db 0FDh, 0
.db 0
.db 1
rorg 0
push hl
ld b, 8
LoopL:
rlc (hl)
inc hl
djnz LoopL
pop hl
scrlLEnd:
; Scroll right
.dw scrlREnd
.db 00111111b
.db 0FCh, 0
.db 0
.db 1
rorg 0
push hl
ld b, 8
LoopR:
rrc (hl)
inc hl
djnz LoopR
pop hl
scrlREnd:
; Scroll up
.dw scrlUEnd
.db 00111111b
.db 0BBh, 5Ah
.db 0
.db 1
rorg 0
push hl
ld e, (hl)
ld b, 7
LoopU:
inc hl
ld a, (hl)
dec hl
ld (hl), a
inc hl
djnz LoopU
ld a, e
ld (hl), a
pop hl
scrlUEnd:
; Screen on
.dw scrOnEnd
.db 00111111b
.db 05h, 0
.db 0
.db 1
rorg 0
ld a, 3
out (10h), a
scrOnEnd:
; Screen off
.dw scrOffEnd
.db 00111111b
.db 0BBh, 5Bh
.db 0
.db 1
rorg 0
ld a, 2
out (10h), a
scrOffEnd:
.dw 0
.dw 01FCh
.db 11
.db "ScrollDown("
.dw 01FAh
.db 11
.db "ScrollLeft("
.dw 01F8h
.db 12
.db "ScrollRight("
.dw 045Eh
.db 9
.db "ScrollUp("
.dw 0Ah
.db 8
.db "ScreenOn"
.dw 0460h
.db 9
.db "ScreenOff"
These 6 commands are in the TYPE menu : [2nd] + [f(x)] / [Y=] + [→]. To use them :
Code: [Select]
Scroll*direction*(Pic1

Scrolls the content of Pic1 one pixel in the given direction and re-stores it to Pic1
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 10, 2012, 04:57:20 am
But what about right and left arrows ? cant use :

0->I
[xxx]->Pic0
[xxx]
.the two sprites are the same!!
While(xxx)
I=I+1%8
Pt-On(0,0,Pic0+I)
End
Title: Re: [Axe] Gravity Walls
Post by: Hayleia on August 10, 2012, 05:29:52 am
But what about right and left arrows ? cant use :

0->I
[xxx]->Pic0
[xxx]
.the two sprites are the same!!
While(xxx)
I=I+1%8
Pt-On(0,0,Pic0+I)
End
Two possibilities:
 - use Matrefeytontias' Axiom, with bit operations
 - use the same method, with sprites but adapted, see below

Code: [Select]
[XXXX]->Str0
[XXXX]
[XXXX]
[XXXX]
[XXXX]
[XXXX]
[XXXX]
[XXXX]
.8 frames for the arrow sprite
.the first one is a simple arrow
.the next one is the previous one shifted by one pixel
.the next one is the previous one shifted by one pixel
.etc
While meh
 I++
 Pt-Off(..,..,I^8*8+Str0)
End

Also, I don't know which language Eiyeron used but that is not Axe :P
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 10, 2012, 05:45:01 am
Is this what you means ?

if I = 0 , Pt-Off(,,Str0)
if I = 1 , Pt-Off(,,Str0+8)
if I = 2 , Pt-Off(,,Str0+16)

you won't use 8 sprites for a single animation ! Must exist a better way ..
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 05:52:49 am
My ASM code will be faster than every Axe routine you can do for scrolling sprite, I recommend you to use it instead of doing the same thing in Axe, which will be heavier and slower.

Also : now I have the collisions working ! :thumbsup:

(http://mattias.refeyton.fr/espace-ti/gravityWalls/blocksCollision.gif)

Next, I'll implement the arrows, and it'll be them which change the gravity. I'll also add a door in order to have a fully functional first level :)

EDIT : I joined the Axiom in *.8xv format.
Title: Re: [Axe] Gravity Walls
Post by: Hayleia on August 10, 2012, 05:55:35 am
Is this what you mean ?

if I = 0 , Pt-Off(,,Str0)
if I = 1 , Pt-Off(,,Str0+8)
if I = 2 , Pt-Off(,,Str0+16)

you won't use 8 sprites for a single animation ! Must exist a better way ..
Yes, that is what I mean, but my code is more efficient than all your Ifs ;)

My ASM code will be faster than every Axe routine you can do for scrolling sprite, I recommend you to use it instead of doing the same thing in Axe, which will be heavier and slower.
Release the 8xv then :P
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 05:58:42 am
Yeah, you're right sorry ^^'
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 10, 2012, 06:45:04 am
cant manipulate bytezs with axe ? because to scroll , you just have to /2 or *2 and add the "neigbour byte"
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 06:46:54 am
Of course you can, but it'll be slow since you can't use bit rotations and shift (what my ASM code does).
Title: Re: [Axe] Gravity Walls
Post by: Hayleia on August 10, 2012, 06:48:35 am
cant manipulate bytezs with axe ? because to scroll , you just have to /2 or *2 and add the "neigbour byte"
Yes, you can. But the problem is not the possibility but the speed and the difficulty. It is also possible to make a raycaster in TI-Basic or a math program in ASM but it is much more convenient to do a raycaster in ASM and a math program in TI-Basic. And shifting a sprite with ASM will probably be faster and smaller than doing it in Axe.

edit: ninja'd
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 10, 2012, 07:49:10 am
Yes but I don't know Asm well :p What is shift ?
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 08:03:15 am
For left and right scrolling, I use respectively the rlc and rrc commands. They are shifting commands, for example you have 10110101. You apply rlc on it ;the command shifts ("décaler" en Français) the bits once on the left, and previous bit 7 is stored into bit 0. So, if you do :
Code: [Select]
rlc %10110101 ; % says that it's a binary number
you get
01101011

Same for rrc, but for the right.
Title: Re: [Axe] Gravity Walls
Post by: Progammer on August 10, 2012, 08:13:39 am
I got it thank you :)
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 08:17:04 am
Since this is just one ASM command repeated, it's way faster than Axe code, which use a lot of routines for it :)
Title: Re: [Axe] Gravity Walls
Post by: V1mes on August 10, 2012, 09:36:21 am
Just out of interest, what kind of routines?
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 09:44:06 am
Here is something in Axe which has the same effect as RLC. Here, I want to do RLC on the address $90D3 :
Code: [Select]
{E90D3}e7 or ({E90D3}*2}→{E90D3}I let you imagine what does Axe, when we can do it in ASM with only two commands :
Code: [Select]
ld hl,$90D3
rlc (hl)
Title: Re: [Axe] Gravity Walls
Post by: Hayleia on August 10, 2012, 09:47:38 am
Here is how to do it in Axe:

Code: [Select]
E90D3
Asm(CB06)
:P
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 10, 2012, 09:52:03 am
But you have to do a loop, since it only scroll one byte out ot 8 ... so you have to do a For loop in Axe, which adds several bytes to the compiled program, when a simple DJNZ statement adds only 3 bytes. My Axiom is still faster and lighter :P
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 16, 2012, 02:21:29 pm
Big, huge, enormous update ! ^^

I've done a playable demo of the game, featuring a title screen, a fully-functionnal physic engine, 4 gravities and 3 playable levels :D

Since I'm in holidays right now, you'll can try it Sunday or Monday ;)
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 19, 2012, 09:55:52 am
Playable demo time ! :D

I won't post any screenshots 'cos I won't resolved the levels for you ^^ (even they are really simple)

You can download it here : http://mattias.refeyton.fr/espace-ti/gravityWalls/GRAVWALL.8xp

I nearly finished the level editor, so you'll see it soon ;)
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 20, 2012, 12:42:00 pm
Update ! (I'm posting all alone --')

Now Gravity Walls v0.5 is fully working ! Download it here : http://mattias.refeyton.fr/espace-ti/gravityWalls/gravityWalls0.5.zip

Includes the game Gravity Walls with the level editor (compiled in Noshell), a five levels pack and a readme :)

Share your comments !

(http://mattias.refeyton.fr/espace-ti/gravityWalls/gravityWalls0.5.gif)
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on August 21, 2012, 08:42:32 am
Update again (really nobody read this thread ?)

Now you can play levels which are in archive ; I also added spikes as tiles.

Same link for download.
Title: Re: [Axe] Gravity Walls
Post by: Hayleia on August 21, 2012, 09:04:37 am
Update again (really nobody read this thread ?)
Well I read it and answer on Espace-TI, and I thought it would be useless to say the same thing here, but if you want, I can :)
Title: Re: [Axe] Gravity Walls
Post by: Stefan Bauwens on August 21, 2012, 01:48:39 pm
Hey, I just noticed this on Ticalc.org today.
It looks awesome and I would probably have replied earlier but I'm not much on Omnimaga lately, since I'm less busy with my calc now.(not that I'm stopping wit programming, just taking a break ;) ).
Anyway, good luck with everything. :)
Title: Re: [Axe] Gravity Walls
Post by: annoyingcalc on September 01, 2012, 04:35:30 pm
Wow! This got front page on ticalc!Click here (http://www.ticalc.org/archives/news/articles/14/148/148065.html)
Title: Re: [Axe] Gravity Walls
Post by: Sorunome on September 01, 2012, 08:06:27 pm
That looks awesome! :D
Title: Re: [Axe] Gravity Walls
Post by: Link on September 01, 2012, 09:33:05 pm
Congrats, and awesome game, really cool concept too! Great work.
Title: Re: [Axe] Gravity Walls
Post by: Matrefeytontias on September 02, 2012, 02:06:01 pm
Thanks all :)

And thanks also annoyingcalc for the poking ^^
Title: Re: Re: [Axe] Gravity Walls
Post by: DJ Omnimaga on September 02, 2012, 03:08:42 pm
Hey looks nice. Congrats on ticalc feature :D