Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: parserp on October 05, 2011, 08:49:56 pm

Title: testing gravity
Post by: parserp on October 05, 2011, 08:49:56 pm
Guess what? you'll never guess.
I wanted to see if I could simulate gravity, and it mostly worked!
this is my first ever real not really game, but sort of useless program in Axe!
I am so happy.
But, I have one question: run the program, and you will see what the problem is, it is too hard to explain.

I guess I should tell you the controls in it:
2nd-turn pixel on
mode-turn pixel off
Y=-clear entire screen
Graph-go to gravity simulator
clear-exit
2nd(while in gravity simulator)-rocket boost
arrow keys-move

source and executable are included
Title: Re: testing gravity
Post by: Happybobjr on October 05, 2011, 09:04:16 pm
compile it for ion plz not asm(
Title: Re: testing gravity
Post by: boot2490 on October 05, 2011, 09:07:44 pm
No! I don't have a shell
Why is ion better?
Title: Re: testing gravity
Post by: parserp on October 05, 2011, 09:10:21 pm
compile it for ion plz not asm(
I have no idea what you are talking about. ???
Title: Re: testing gravity
Post by: Darl181 on October 05, 2011, 09:11:34 pm
Hbj: he included the source ;)
EDIT double ninja'd, blarg

So, the problem is when the char tries walk up a slope, it goes through it?  Try pixel-testing the pixels next to the feet, see if that fixes it.
I haven't looked at the source but I'd erase the initial sprite as well, so it doesn't stay there the entire time.


@parser in Axe you can select what to compile it for.  He's suggesting to compile for Ion instead of "No Shell."
Title: Re: testing gravity
Post by: parserp on October 05, 2011, 09:14:20 pm
Hbj: he included the source ;)

So, the problem is when the char tries walk up a slope, it goes through it?  Try pixel-testing the pixels next to the feet, see if that fixes it.


@parser in Axe you can select what to compile it for.  He's suggesting to compile for Ion instead of "No Shell."
oh, i never realized that problem, but i will fix that.
the problem i was referring to was when you first enter the gravity simulator, then when you move, a copy of the guy just sits there, and for some reason i can't get rid of him...
Title: Re: testing gravity
Post by: Happybobjr on October 05, 2011, 09:26:29 pm
well i guess it doesn't matter :P
I just cant get it to run :/
Title: Re: testing gravity
Post by: parserp on October 05, 2011, 09:27:58 pm
what calc do you have?
i made it on an 84+ se
Title: Re: testing gravity
Post by: Happybobjr on October 05, 2011, 09:37:30 pm
running it on Wabbit on 84PSE
Title: Re: testing gravity
Post by: parserp on October 05, 2011, 09:38:42 pm
this may sound stupid, but what's Wabbit? ???
a lot of people talk about it.
Title: Re: testing gravity
Post by: Happybobjr on October 05, 2011, 09:48:48 pm
emulator
Title: Re: testing gravity
Post by: Darl181 on October 05, 2011, 09:50:27 pm
http://wabbit.codeplex.com/
The best of the z80 emulators, and in active development :)
(more recent version under the Downloads tab)

I'm looking at the source now, btw.

EDIT:
Code: (from source) [Select]
Pt-Off(40,55,Pic3)Try getting rid of/commenting away this line, then see if it works.
Title: Re: testing gravity
Post by: parserp on October 06, 2011, 07:02:32 pm
Sweet thanks. don't know how that got in there.
new one should be coming soon...
Title: Re: testing gravity
Post by: DJ Omnimaga on October 06, 2011, 09:10:35 pm
No! I don't have a shell
Why is ion better?
It isn't much better, but when compiling a program No Stub (Asm(prgmNAME)), it doesn't show up under Ion nor MirageOS, only in Doors CS7. If compiled for Ion it cannot be ran from Asm(), but at least it shows up in every shell and in addition to that with Doors CS7 you can run it without the Asm( prefix like a BASIC program.
Title: Re: testing gravity
Post by: Darl181 on October 06, 2011, 09:20:17 pm
Quote
with DCS7
...and zStart, and NoShell, and CalcUtil, and maybe some others.
;)
Title: Re: testing gravity
Post by: Quigibo on October 06, 2011, 09:25:08 pm
If compiled for Ion it cannot be ran from Asm()

Actually it can, and it's always been able to :)
Title: Re: testing gravity
Post by: LincolnB on October 06, 2011, 09:26:48 pm
Hey, this is pretty sweet. Is that my drawing function I see there? ;)
Title: Re: testing gravity
Post by: parserp on October 06, 2011, 10:00:37 pm
Ok, here is the newest (and greatest) update.
Things added: slope detection (thanks to Darl181) and erased origional sprite. :)

Hey, this is pretty sweet. Is that my drawing function I see there? ;)
not exactly, but it was inspired by your water program.  ;D
(Credit to you too)
is that ok?
Title: Re: testing gravity
Post by: LincolnB on October 06, 2011, 11:29:18 pm
Yeah, that's totally fine. I was just curious. It's cool.
Title: Re: testing gravity
Post by: parserp on October 07, 2011, 05:00:08 pm
Sweet thanks. :)


EDIT: how do you do screenshots?
Title: Re: testing gravity
Post by: Hayleia on October 08, 2011, 12:28:04 pm
EDIT: how do you do screenshots?
You download Wabbitemu (http://download.codeplex.com/Download?ProjectName=wabbit&DownloadId=122222&FileTime=129621511134970000&Build=18207), then send your program to the virtual calc, press backspace and record :)

(If I don't have the right to put the link, could an admin remove it please ?)
Title: Re: testing gravity
Post by: BalancedFury on October 08, 2011, 12:31:24 pm
this may sound stupid, but what's Wabbit? ???
a lot of people talk about it.

A calculator emulator
(YAY, A RHYME!!
:w00t:)
Title: Re: testing gravity
Post by: parserp on October 08, 2011, 01:54:42 pm
EDIT: how do you do screenshots?
You download Wabbitemu (http://download.codeplex.com/Download?ProjectName=wabbit&DownloadId=122222&FileTime=129621511134970000&Build=18207), then send your program to the virtual calc, press backspace and record :)

(If I don't have the right to put the link, could an admin remove it please ?)
backspace ???
Title: Re: testing gravity
Post by: Darl181 on October 08, 2011, 01:58:15 pm
I don't see why there would be some restriction on the link, it's freeware :P

And "backspace" is the key that deletes letters.
Title: Re: testing gravity
Post by: parserp on October 08, 2011, 01:59:13 pm
k i'll try it again...
edit: is it supposed to not show the screenshot while you are recording it in the little window?
Title: Re: testing gravity
Post by: boot2490 on October 08, 2011, 10:23:44 pm
It should have a glowing blue border.
Title: Re: testing gravity
Post by: aeTIos on October 09, 2011, 06:01:05 am
I would swear that I posted some big post here....
Title: Re: testing gravity
Post by: Wellen on October 09, 2011, 06:27:38 am
I would swear that I posted some big post here....
Yeah with a bakspace-key picture ? I believe I answered you ^^
Title: Re: testing gravity
Post by: aeTIos on October 09, 2011, 06:33:43 am
yup
or maybe that was somewhere else...
idk.
Title: Re: testing gravity
Post by: LincolnB on October 09, 2011, 09:24:21 pm
Hey, ima make you a screenie.

(http://img.removedfromgame.com/imgs/testing_gravity.gif)
Title: Re: testing gravity
Post by: ztrumpet on October 09, 2011, 09:54:23 pm
It looks pretty awesome, parser.  Excellent work. :)
Title: Re: testing gravity
Post by: parserp on October 10, 2011, 03:49:27 pm
Hey, ima make you a screenie.

(http://img.removedfromgame.com/imgs/testing_gravity.gif)
hey, that looks farmiliar ;)
thanks butts!
Title: Re: testing gravity
Post by: boot2490 on October 10, 2011, 06:00:58 pm
Wow! How did you get slopes to work???

Can I use this (or parts of it) for my game?
Title: Re: testing gravity
Post by: parserp on October 10, 2011, 06:08:38 pm
Wow! How did you get slopes to work???

Can I use this (or parts of it) for my game?
of course you can! I love to be of service.
check out the source, I commented it as much as possible...
happy programming! :trollface:
nice emoticon. :)

EDIT: just please give me credit  ;)
Title: Re: testing gravity
Post by: boot2490 on October 10, 2011, 06:39:25 pm
I will, but I am very busy as of late and I am actually considering taking a one week break from omni.
I have more than three sprite requests, almost ten projects of my own, and more schoolwork than ever. But, I try to multitask.
Title: Re: testing gravity
Post by: aeTIos on October 11, 2011, 10:37:23 am
*cough* jumping *cough*
looks good btw.
Title: Re: testing gravity
Post by: boot2490 on October 11, 2011, 11:21:53 am
The jumping looks kinda forced, though, it doesn't slow down at the top, and it jumps too high.
Title: Re: testing gravity
Post by: LincolnB on October 11, 2011, 02:31:44 pm
In the program, you don't actually jump. You use your rocket booster and go upwards.
Title: Re: testing gravity
Post by: Yeong on October 11, 2011, 03:07:58 pm
The screenshot looks awesome!
*Yeong wonders how to make slope(up) work
Title: Re: testing gravity
Post by: aeTIos on October 11, 2011, 03:25:37 pm
yeah, thats cool.
Title: Re: testing gravity
Post by: boot2490 on October 11, 2011, 06:18:43 pm
How does the slope work?
Title: Re: testing gravity
Post by: parserp on October 11, 2011, 08:22:15 pm
How does the slope work?


First of all, here's the guy sprite: (for the pxl-Tests)
00111000
00101000
00111000
00010000
01111100
00010000
00101000
00101000
Quote from: code
Code: [Select]
:./= this means "does not equal to"
:.X is the players X position and Y is the players Y position
:
:.see if going up slope to the left
:
:If getKey(2) and (X/=1) and (pxl-Test(X+2,Y+7)) and (Y/=1)
:Y-1->Y
:End
:
:.see if just going left
:
:If getKey(2)
:X-1->X
:End
:
:see if going up slope to the right
:
:If getKey(3) and (X/=88) and (pxl-Test(X+6,Y+7)) and (Y/=1)
:Y-1->Y
:End
:
:.see if just going right
:
:If getKey(3) and (X/=88)
:X+1->X
:End

all it is is just pxl tests near the feet, seeing if there is a slope.
hopefully that helped. :)
Title: Re: testing gravity
Post by: boot2490 on October 12, 2011, 04:18:03 pm
That makes sense. Cool!
Title: Re: testing gravity
Post by: parserp on October 15, 2011, 10:52:30 pm
Woot I finally found out how to do screenies!!!  :w00t:
Title: Re: testing gravity
Post by: Deep Toaster on October 15, 2011, 11:05:38 pm
This is late, but
No! I don't have a shell
Why is ion better?
You can run programs compiled for Ion directly from the homescreen as well, no shells needed.
Title: Re: testing gravity
Post by: DJ Omnimaga on November 12, 2011, 12:01:51 am
If compiled for Ion it cannot be ran from Asm()

Actually it can, and it's always been able to :)
Not all the time. Some games, such as Ztetris, crashes on exit, and a bunch of other Ion games did not run at all (ERR:INVALID or RAM Clear). ??? Galaxian was the only Ion game I could get to run with Asm()

Also this looks nice parser.  You should make the rocket gravity more realistic, though, so you start falling gradually or moving up slowly then faster, like in one of Darl181's engine.
Title: Re: testing gravity
Post by: Builderboy on November 12, 2011, 12:23:32 am
Well what I think Quigibo means is that if you compile a program using Axe for Ion, it will always be able to be run using Asm()
Title: Re: testing gravity
Post by: DJ Omnimaga on November 12, 2011, 12:34:39 am
Oh ok, I guess Axe does it right then.