Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started 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)
-
Up !
Now with screenshots !
-
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
-
Eeeeeer no I'm not :D but it's right that I took the character from Graviter and Portal X.
-
It does indeed sound like quite the awesome project ^^ I'm glad to see the gravity games getting a revival :P
-
Cool idea :D
Can't wait see this one finished
-
How do you get the "scrolling arrows effect" ?
-
Idea: make two same sprites, and in a loop:
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 ;)
-
ah ok , thank's a lot
-
I ust added something, you just have to make two same sprites
-
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.
-
May we take a look at it's source? THat could be VERY useful!
-
I ust added something, you just have to make two same sprites
Yeah I guessed
-
May we take a look at it's source? THat could be VERY useful!
Of course :)
Here are the file axmwalls.z80 : .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 :Scroll*direction*(Pic1
Scrolls the content of Pic1 one pixel in the given direction and re-stores it to Pic1
-
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
-
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
[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
-
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 ..
-
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.
-
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
-
Yeah, you're right sorry ^^'
-
cant manipulate bytezs with axe ? because to scroll , you just have to /2 or *2 and add the "neigbour byte"
-
Of course you can, but it'll be slow since you can't use bit rotations and shift (what my ASM code does).
-
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
-
Yes but I don't know Asm well :p What is shift ?
-
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 :
rlc %10110101 ; % says that it's a binary number
you get
01101011
Same for rrc, but for the right.
-
I got it thank you :)
-
Since this is just one ASM command repeated, it's way faster than Axe code, which use a lot of routines for it :)
-
Just out of interest, what kind of routines?
-
Here is something in Axe which has the same effect as RLC. Here, I want to do RLC on the address $90D3 :
{E90D3}e7 or ({E90D3}*2}→{E90D3}
I let you imagine what does Axe, when we can do it in ASM with only two commands :ld hl,$90D3
rlc (hl)
-
Here is how to do it in Axe:
E90D3
Asm(CB06)
:P
-
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
-
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 ;)
-
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 ;)
-
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)
-
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.
-
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 :)
-
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. :)
-
Wow! This got front page on ticalc!Click here (http://www.ticalc.org/archives/news/articles/14/148/148065.html)
-
That looks awesome! :D
-
Congrats, and awesome game, really cool concept too! Great work.
-
Thanks all :)
And thanks also annoyingcalc for the poking ^^
-
Hey looks nice. Congrats on ticalc feature :D