Author Topic: Axe Snake  (Read 17194 times)

0 Members and 1 Guest are viewing this topic.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Snake
« Reply #15 on: June 16, 2010, 07:34:46 pm »
You shouldn't be using the normal getkey for games.  Its slow and it returns funky stuff sometimes.  That code should be:

Code: [Select]
Pause 50
X+getKey(3)-getKey(2)->X
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Snake
« Reply #16 on: June 16, 2010, 07:39:40 pm »
I'm using it to get input for the user to type their name, so I don't want a lot of statements.  I pretty much need getKey to use with my look up table.
Nemo, I'm using it the second way.  Still no luck. =(
« Last Edit: June 16, 2010, 09:39:49 pm by ztrumpet »

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Axe Snake
« Reply #17 on: June 16, 2010, 07:43:08 pm »
quigibo, the BASIC way of getkey functions better for a menu. at least, for me it does. with yours it has the possibility of skipping an item. and if i increase the pause, my menu just looks like it's responding ridiculously slow.

sorry ztrumpet  :-\ i don't have anything else, except maybe quigibo's way will work. i suggest upping the pause to about 200-250 though, since 50 you have to deliberately try to not skip the middle item(s) in your menu

EDIT: offtopic, quigibo, are sine, cosine and the signed division routine really slow or did i accidentally put a delay in my program?
« Last Edit: June 16, 2010, 07:46:51 pm by nemo »


Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Snake
« Reply #18 on: June 16, 2010, 07:59:24 pm »
Yeah, I wasn't sure if this was for a menu or part of the game.  Regular getkey is definitely good for menus.

Signed division is definitely the slowest of the 3.  The reason the circle looks a little square-ish is that I'm using a very fast approximation of sine and cosine for performance reasons.  Normally you don't notice it at all unless you draw the trail of the sprite.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Axe Snake
« Reply #19 on: June 16, 2010, 08:05:10 pm »
 :-\ alright. i'm only doing two signed divisions, two sines and two cosines and that section of my program is already as slow as the other which calls a subroutine 6 times for tilemap collision detection, and then has a volley of if statements to determine what to do. if there's any way to improve the signed division routine, that would be excellent. seeing as i don't even know what parsing actually does, i'm not exactly in a position to talk


Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Snake
« Reply #20 on: June 16, 2010, 09:41:00 pm »
I've confirmed that adding
Output(6)
Disp B>Dec
right after the getKey always returns a zero. :(

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Snake
« Reply #21 on: June 17, 2010, 12:38:17 am »
You didn't disable intterupts did you?  They are required for getkey.
___Axe_Parser___
Today the calculator, tomorrow the world!

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 Snake
« Reply #22 on: June 17, 2010, 03:29:06 am »
interrupts? Do you mean we must do FnOn at the start of our programs to be able to use getkey() now?

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Snake
« Reply #23 on: June 17, 2010, 03:36:05 am »
No, they're enabled by default.  You just shouldn't call fnOff without enabling it again if you plan to use OS getkey
« Last Edit: June 17, 2010, 03:36:41 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

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 Snake
« Reply #24 on: June 17, 2010, 04:15:07 am »
Oh ok. By OS getkey you mean getkey without the (), right?

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Snake
« Reply #25 on: June 17, 2010, 04:18:16 am »
Correct
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Snake
« Reply #26 on: June 23, 2010, 10:50:40 am »
There are no FnOffs in the program. :(

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 Snake
« Reply #27 on: June 23, 2010, 11:22:53 am »
Could you maybe post your code via Quigibo PMs in case this might be a bug?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Snake
« Reply #28 on: June 23, 2010, 11:26:30 am »
The code's in the first post, in program form.  To clarify, this is NOT a contest entry. :)

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 Snake
« Reply #29 on: June 23, 2010, 11:27:02 am »
Oh ok I thought this was the executable, I must have forgotten x.x