Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Spenceboy98 on February 15, 2013, 04:21:24 pm

Title: [AXE] Slime Volleyball
Post by: Spenceboy98 on February 15, 2013, 04:21:24 pm
There was this game I used to play on the internet, and I don't remember what website it was on or what it was called. The gave was between two semi-circles with eyes. They hit a ball back and forth until one of them dropped it. If someone knows this game, I would appreciate if you'd tell me what it's called.

Anyways, I Decided to try to recreate it in Axe, and this is what I have so far:
(http://img.removedfromgame.com/imgs/TennisTest.gif)

This is my code so far:
Code: [Select]
:.TENNIS
:#Icon(0000000000000000000000000000000003C00FF01FF83F9C7F9E7FFEFFFFFFFF)
:[030F1F3F7F7FFFFF]→Pic1
:[C0F0F89C9EFEFFFF]
:[030C1026464080FF]→Pic2
:[C0300804020201FF]
:0→X
:56→Y
:88→Z
:56→W
:0.1→G
:0→V
:Repeat getKey(15)
:ClrDraw
:G+V→V
:Pt-On(X,Y,Pic1
:Pt-On(X+8,Y,8+Pic1
:If Y≥56
:56→Y
:0→V
:End
:Y+V→Y
:If getKey(2) and (X>0)
:X-1→X
:End
:If getKey(3) and (X<80)
:X+1→X
:End
:If getKey(54) and (Y=56)
:-4→V
:Y+V→Y
:End
:DispGraph
:End

I want to make the jumping slower(without reducing the height of jump), so if anyone could help me with that, it would be appreciated. Also, if anyone could help me with some physics(ball bouncing off the semicircle), that would be nice too(I'll be looking on Google for this, but if you know of something, by all means, reply and post it).
Title: Re: [AXE] Tennis(Name Unofficial)
Post by: Matrefeytontias on February 15, 2013, 04:38:56 pm
I can't help you with the bounce, but to make the jump slower (and with this method, it'll be more realistic too), you'll have to modify your code a bit :

If you have any problem with it, please ask :)
Title: Re: [AXE] Tennis(Name Unofficial)
Post by: jsj795 on February 15, 2013, 05:41:25 pm
There was this game I used to play on the internet, and I don't remember what website it was on or what it was called. The gave was between two semi-circles with eyes. They hit a ball back and forth until one of them dropped it. If someone knows this game, I would appreciate if you'd tell me what it's called.

The game is called Slime tennis. Good luck with the game!
Title: Re: [AXE] Tennis(Name Unofficial)
Post by: Spenceboy98 on February 15, 2013, 05:49:26 pm
There was this game I used to play on the internet, and I don't remember what website it was on or what it was called. The gave was between two semi-circles with eyes. They hit a ball back and forth until one of them dropped it. If someone knows this game, I would appreciate if you'd tell me what it's called.

The game is called Slime tennis. Good luck with the game!

Thanks. But now that I look at that site, I'm pretty sure it was the Slime Volleyball one. I'm gonna change the title now. :P
Title: Re: [AXE] Slime Volleyball
Post by: Hayleia on February 16, 2013, 07:44:58 am
This game has already been ported to the z80 series (http://www.ticalc.org/archives/files/fileinfo/290/29096.html) ;)
However, I'd be glad to see another version of it with more features and more graphics (the one I linked to doesn't have what we can call a menu) :D
Title: Re: [AXE] Slime Volleyball
Post by: Spenceboy98 on February 16, 2013, 10:57:26 am
I can't help you with the bounce, but to make the jump slower (and with this method, it'll be more realistic too), you'll have to modify your code a bit :
  • Just use one variable that you will always add to Y for the gravity. Let's say that you use G.
  • Add G to Y before testing if Y is outbounds. It'll prevent your sprite to go off the screen for a frame (which can be a bit strange for the eye).
  • As an acceleration due to gravity, G is always increasing (making Y go up, and then your sprite fall). Each loop, just increase G, preferably after adding it to Y and before testing the bounds. If your sprite is on the floor, make G zero, so this way G will always be set to zero when you touch the ground, preventing your sprite to go off the screen.
  • When you jump, make G (for example) -3. Then the next frame, Y will be Y+(-3) = Y - 3, making the sprite jump 3 pixels up. The next frame, G will be increased to -2. Then Y will be Y - 2 and the sprite will go up 2 pixels again. This will continue until G is greater than zero and make your sprite fall again to the ground, and until G is reset to zero after the sprite touches the ground. You'll probably have to test some values to set G to for the jump before getting the right one.

If you have any problem with it, please ask :)
Thanks!

This game has already been ported to the z80 series (http://www.ticalc.org/archives/files/fileinfo/290/29096.html) ;)
However, I'd be glad to see another version of it with more features and more graphics (the one I linked to doesn't have what we can call a menu) :D

I can try my best. I'm probably going to make it as close to the original as possible. I'll probably come up with my own menu. :P
Title: Re: [AXE] Slime Volleyball
Post by: Sorunome on February 16, 2013, 02:31:50 pm
w00t, slimes for the calc!/me is looking forward to the finished project
Title: Re: [AXE] Slime Volleyball
Post by: DJ Omnimaga on March 07, 2013, 03:39:47 am
A new version with more features would definitively be nice. Maybe do it exactly like the 68K one with grayscale backgrounds?
Title: Re: [AXE] Slime Volleyball
Post by: Hayleia on March 07, 2013, 05:58:28 am
This is what I love with open-source projects, everyone can contribute :D

So SpenceBoy, here is the code with some lines changed:
-I added a grey background
-I added inflation by 256 (for more precision)
-I inverted the lines such as "getKey(...) and (meh>blah)" into "meh>blah and getKey(...)" to get rid of useless parenthesises
-I didn't optimize anything since it is your project so I don't want to interfere with your way of coding ;)

New source code in attachement and in spoiler, with screenshot :)

Spoiler For Spoiler:
.TENNIS
[030F1F3F7F7FFFFF]->Pic1
[C0F0F89C9EFEFFFF]
[030C1026464080FF]->Pic2
[C0300804020201FF]
0->X
56->Y
88->Z
56->W
0.1->G
0->V
Repeat getKey(15)
 ClrDraw
 G+V->V
 Pt-On(X/256,Y/256,Pic1)
 Pt-On(X/256+8,Y/256,8+Pic1)
 If Y/256>=56
  56*256->Y
  0->V
 End
 Y+V->Y
 If  X>0 and getKey(2)
  X-256->X
 End
 If X/256<80 and getKey(3)
  X+256->X
 End
 If Y/256=56 and getKey(54)
  ~256->V
  Y+V->Y
 End
 DispGraph(L6,°BG)^^r
End

Return

[]->°BG
[00000000000000000000000000000000000000000000000000000000000000000000000000000000003F8000000000000000000003FFF00000000000000000000FFFFE0000000000000000003FFFFF800000000000000000FFFFFFE00000000000000000FFFFFFF00000000000000007FFFFFFF80000000000000007FFFFFFFC000000000000000FFFFFFFFE000000000000000E000071FE000000000000003E000071FF000000000000003E000071FF800000000000007FFE3FF1FFC00000000000007FFE3FF1FFC0000000000000FFFE3FF1FFC0000000000000FFFE3FF1FFE0000000000000FFFE3FF1FFE0000000000000FFFE3FF1FFF0000000000001FFFE3FF1FFF0000000000003FFFE3FF1FFF0000000000007FFFE3FF1FFF0000000000007FFFE3FF1FFF0000000000005FFFE3FF1FFF000000000000DFFFE3FF1FFF000000000000DFFFE3FF1FFF0000000000019FFFE3FF1FFF0000000000019FFFE3FF1FFF0000000000019FFFE3FF1FFF0000000000018FFFE3FF1FFE0000000000018FFFE3FF1FFE0000000000030FFFFFFFFFFE0000000000030FFFFFFFFFFE00000000000307FFDFFFF7FC00000000000307F8D8E733FC00000000000307FB56DAD7F800000000000303FB5CDA17F800000000000301FB52DAF7F000000000000301F8D15A11E000000000000180FBFFFFFFF8000000000001807BFFFFFFFE000000000001803FFFFFFFFF000000000001800FFFFFFFFF800000000001C007FFFFFFFFC00000000000C001FFFFFFFFC00000000000E0007FFFF8CCC0000000000060000FFC3ABB400000000000700000003ABB4000000000003800000028B8C000000000001C0000003FFBC000000000000E0000003FFCC0000000000007800001FFFF80000000000003C00007FFFF80000000000001FC003FEFFF000000000000007FFFFF87FE000000000000000FFFF800F00000000000000001FFC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000]

edit that background is the only image that I had available directly in hex and that was not a trollface so I put that for example, but it can be easily changed ;)
edit 2 forgot the spoiler :P
Title: Re: [AXE] Slime Volleyball
Post by: Loulou 54 on March 07, 2013, 10:27:15 am
That looks nice ! :)
Almost exactly the same game has been released on 68k calculator. Its name is SlimeBall :

(http://www.ticalc.org/archives/files/ss/458/45882.gif)
Download (http://www.ticalc.org/archives/files/fileinfo/340/34000.html)

It is really nice to play ! You have some options wich allow you to change the gameplay. (such as changing gravity, moving the "net" between both players, ...) I have played it a lot. :)
So try it if you can ! (emulator could be useful : TI-Emu, VTI, ...) ;)

In the same style too, look at my game "Palet" in my sign ! :P
Title: Re: [AXE] Slime Volleyball
Post by: DJ Omnimaga on March 07, 2013, 02:18:37 pm
Yep, pretty similar. Also glad you added smooth jumping Hayleia :P
Title: Re: [AXE] Slime Volleyball
Post by: Hayleia on March 07, 2013, 02:22:28 pm
Yep, pretty similar. Also glad you added smooth jumping Hayleia :P
Well I just made it more obvious by adding inflation by 256 but I didn't add it, it is SpenceBoy's work ;)
Title: Re: [AXE] Slime Volleyball
Post by: DJ Omnimaga on March 07, 2013, 02:23:28 pm
What's inflation? ???
Title: Re: [AXE] Slime Volleyball
Post by: Hayleia on March 07, 2013, 02:26:48 pm
What's inflation? ???
I don't know what that word means (:P) but "inflation by Z" is somehow a programming technic. Basically, when your coordinate increases by one, you don't move of a pixel. You only move by a pixel when your coordinate increased by Z. And 256 is a good number because dividing by 256 is really optimized for Axe :)
Title: Re: [AXE] Slime Volleyball
Post by: DJ Omnimaga on March 07, 2013, 02:37:25 pm
Ah I see. I assume it's mostly for jumping precision?
Title: Re: [AXE] Slime Volleyball
Post by: Hayleia on March 07, 2013, 02:39:23 pm
Ah I see. I assume it's mostly for jumping precision?
Yes, exactly this (I know, my explanations are always confusing, you should not have asked me but someone else :P)
Title: Re: [AXE] Slime Volleyball
Post by: TIfanx1999 on March 11, 2013, 08:20:28 am
What's inflation? ???
I don't know what that word means (:P) but "inflation by Z" is somehow a programming technic. Basically, when your coordinate increases by one, you don't move of a pixel. You only move by a pixel when your coordinate increased by Z. And 256 is a good number because dividing by 256 is really optimized for Axe :)
Inflation means to expand or make larger. :)
Title: Re: [AXE] Slime Volleyball
Post by: Hayleia on March 11, 2013, 02:25:01 pm
What's inflation? ???
I don't know what that word means (:P) but "inflation by Z" is somehow a programming technic. Basically, when your coordinate increases by one, you don't move of a pixel. You only move by a pixel when your coordinate increased by Z. And 256 is a good number because dividing by 256 is really optimized for Axe :)
Inflation means to expand or make larger. :)
Ok, thanks. Yeah that makes sense with the fact all numbers are multiplied by 256 :)
Also, yeah, I remember now what "inflatable" means (saw that in Professor Fizzwizzle :P) so I could have guessed "inflation".
Title: Re: [AXE] Slime Volleyball
Post by: Spenceboy98 on March 11, 2013, 07:48:54 pm
I haven't worked on this in a while. I couldn't figure out the ball physics. Thanks for the help with the jumping. I'm debating whether or not I should use a background image.