Author Topic: [AXE] Slime Volleyball  (Read 6994 times)

0 Members and 1 Guest are viewing this topic.

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
[AXE] Slime Volleyball
« 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:


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).
« Last Edit: February 15, 2013, 05:51:32 pm by Spenceboy98 »
I like milk.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [AXE] Tennis(Name Unofficial)
« Reply #1 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 :
  • 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 :)
« Last Edit: February 15, 2013, 04:39:32 pm by Matrefeytontias »

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: [AXE] Tennis(Name Unofficial)
« Reply #2 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!


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: [AXE] Tennis(Name Unofficial)
« Reply #3 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
« Last Edit: February 15, 2013, 05:49:39 pm by Spenceboy98 »
I like milk.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [AXE] Slime Volleyball
« Reply #4 on: February 16, 2013, 07:44:58 am »
This game has already been ported to the z80 series ;)
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 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 Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: [AXE] Slime Volleyball
« Reply #5 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 ;)
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
I like milk.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [AXE] Slime Volleyball
« Reply #6 on: February 16, 2013, 02:31:50 pm »
w00t, slimes for the calc!
* Sorunome is looking forward to the finished project

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [AXE] Slime Volleyball
« Reply #7 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?

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [AXE] Slime Volleyball
« Reply #8 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
« Last Edit: March 07, 2013, 06:44:17 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 Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: [AXE] Slime Volleyball
« Reply #9 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 :


Download

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
« Last Edit: March 07, 2013, 10:30:02 am by Loulou 54 »
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [AXE] Slime Volleyball
« Reply #10 on: March 07, 2013, 02:18:37 pm »
Yep, pretty similar. Also glad you added smooth jumping Hayleia :P

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [AXE] Slime Volleyball
« Reply #11 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 ;)
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 DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [AXE] Slime Volleyball
« Reply #12 on: March 07, 2013, 02:23:28 pm »
What's inflation? ???

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [AXE] Slime Volleyball
« Reply #13 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 :)
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 DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [AXE] Slime Volleyball
« Reply #14 on: March 07, 2013, 02:37:25 pm »
Ah I see. I assume it's mostly for jumping precision?