This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Project Ideas/Start New Projects => Your Projects
Author Message
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 22 Feb 2006 09:31:20 pm    Post subject:

I had originally announced on MaxCoderz that I had made an engine for N in TI-BASIC, and intended to post the source code there, but the forum seems to be down at the moment. You can get it here instead.

Walls should be at least two pixels thick for consistent collision detection.
M - vertical position, always an integer
N - horizontal position, always an integer (N for Ninja)
U - vertical velocity, floating point number
V - horizontal velocity, floating point number (V for Velocity)


Code:
Pxl-Change(M,N
Repeat K=45
getKey\->\K
If Vpxl-Test(M,N+1-2(V<0
Then
V/abs(V)(.1-1.1(K=21))+(Ans=26)-(Ans=24\->\V
1-3(K=21\->\U
Else
If pxl-Test(M+1,N
Then
.6V+(Ans=26 and V<2)-(Ans=24 and V>-2\->\V
-2.5(K=21\->\U
Else
.8V+.5((Ans=26 and V<2)-(Ans=24 and V>-2\->\V
U+.25((U<2)+(U<0 and not(iPart(Ans\->\U
End
End
Pxl-Change(M,N
iPart(M+Ans+.5
Ans-pxl-Test(Ans,N)((U>0)-(U<0\->\M
iPart(N+V+.5
Ans-pxl-Test(M,Ans)((V>0)-(V<0\->\N
Pxl-Change(M,Ans
End

Have fun with it! :biggrin:

I plan on adding mines and gold, as well as tile-based levels. Post any suggestions here, but keep in mind that the specific numbers in the program are the result of a lot of testing. If you think the coefficients should be changed to something else, be sure to try them out yourself before posting them.
Back to top
kalan_vod


Advanced Member


Joined: 04 Sep 2005
Posts: 446

Posted: 23 Feb 2006 04:47:02 am    Post subject:

I tried it and it wroks really good, but good thing axes were on otherwise I would've just fell Very Happy. I made it into a program so more people could try it (those who are lazy Very Happy).

CLICKY <---------CLICK NOW!!!
Back to top
Liazon
title goes here


Bandwidth Hog


Joined: 01 Nov 2005
Posts: 2007

Posted: 23 Feb 2006 08:35:29 am    Post subject:

it's that short???
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 23 Feb 2006 03:59:39 pm    Post subject:

Thanks kalan_vod, for posting the program to download.

Quote:
it's that short???
Yes. :biggrin: It has to be, so it will run quickly.

I'm sorry to announce that I will be abstaining from the forums for a couple weeks to focus on my schoolwork. So don't expect me to reply to your comments for a while.

My last binge will be to post the pseudo-code for the engine. If you see me back before two weeks are up, smack me a few times.

Code:
Draw the ninja
Repeat until the user presses CLEAR:
     Save the keypress
     If there is a wall in front of the ninja:
          Minimize the horizontal speed,
               increasing it if the user pressed 2nd or an arrow key
          Set the vertical velocity to a slow slide down,
               unless the user pressed 2nd to jump
     Otherwise,
          If there is a floor beneath the ninja:
               Reduce horizontal speed from friction,
                    increasing it if the user pressed an arrow key to run
               Set the vertical velocity to zero,
                    unless the user pressed 2nd to jump
          Otherwise,
               Reduce horizontal speed from air resistance,
                    increasing it a little if the user pressed an arrow key to move
               Add gravitational acceleration to vertical velocity,
                    reducing jump power if the ninja isn't moving
     Erase the ninja
     Update the vertical position with the vertical velocity
     Push the ninja back a little if it is inside a wall
     Update the horizontal position with the horizontal velocity
     Push the ninja back a little if it is inside a wall
     Draw the ninja
Back to top
Liazon
title goes here


Bandwidth Hog


Joined: 01 Nov 2005
Posts: 2007

Posted: 23 Feb 2006 05:23:42 pm    Post subject:

axcho wrote:
I'm sorry to announce that I will be abstaining from the forums for a couple weeks to focus on my schoolwork. So don't expect me to reply to your comments for a while.

My last binge will be to post the pseudo-code for the engine. If you see me back before two weeks are up, smack me a few times.


that's what I try to do, but I just end up posting on the forums and not programing. At least I made 4.6% progress on the isometric game over break :biggrin: :biggrin: :biggrin: :biggrin:

unfortunately not much progress until the next break :biggrin: :biggrin: :biggrin: :biggrin:

edit:

@axcho, CompWiz: I'm kind of caught up with my own game. If I finish next break, then I might be able to start working on an 89 version of this with sprites. Can't make any guarantees though Sad


Last edited by Guest on 23 Feb 2006 05:25:40 pm; edited 1 time in total
Back to top
threefingeredguy


Advanced Member


Joined: 01 Sep 2005
Posts: 479

Posted: 24 Feb 2006 11:53:30 pm    Post subject:

a, that is exactly like the engine i wrote for some game, except this has velocity and all mine had was reversible gravity. Your code looks almost the same as mine for the most part.
Back to top
kalan_vod


Advanced Member


Joined: 04 Sep 2005
Posts: 446

Posted: 26 Feb 2006 11:23:37 pm    Post subject:

threefingeredguy wrote:
a, that is exactly like the engine i wrote for some game, except this has velocity and all mine had was reversible gravity. Your code looks almost the same as mine for the most part.
[post="70691"]<{POST_SNAPBACK}>[/post]

Dont you hate it when that happens? Looks good, hows the addition of stuff coming along?
Back to top
CompWiz


Advanced Newbie


Joined: 16 Oct 2005
Posts: 66

Posted: 27 Feb 2006 03:07:56 pm    Post subject:

sounds great, I'll try it out when I get home later on today. I'm glad to see that this is being worked on. I wish I had the time to start work on an asm version with sprites, but I'm really busy right now. Hopefully I'll have some time soon to spend working on learning asm, and trying out some code for this program. Smile
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 14 Mar 2006 09:14:31 pm    Post subject:

I'm back! I have two weeks off now before I start school again.

It doesn't seem like you missed me very much... Rolling Eyes

Well, I have learned many new and wonderful things in the past few weeks. It seems like such a long time since I last saw a calculator forum. I have been occupying my time online with flash animations and games, mainly of stick figure battles. It is surprising how few good stick fighting games there are on the web. The only good ones are pretty much Madness Interactive and Bullet Time Fighting, which enjoy top places on flash game sites. I think I could make a better fighting game though! Ahhh, the glory when I oust Madness Interactive from the number one spot...
Back to top
threefingeredguy


Advanced Member


Joined: 01 Sep 2005
Posts: 479

Posted: 15 Mar 2006 01:15:12 am    Post subject:

MMO N-Game. It's possible in flash with shared objects. I never was able to get the hang of it though...
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 15 Mar 2006 05:10:24 am    Post subject:

Quote:
MMO N-Game. It's possible in flash with shared objects. I never was able to get the hang of it though...
Get the hang of what? Do you mean networked Flash? (You've tried networking with Flash already and you haven't told me? Neutral ) Or is there already a massively multiplayer N?

If you visit the N forums, you'll find that the regulars there are very resistant to most suggestions for new versions of the game. Apparently many people suggest adding weapons or powerups, which would completely change the flavor of it. So I doubt they'd be enthusiastic about a massively multiplayer version. But yeah, something like that, except not trying to be N at the same time.


Last edited by Guest on 15 Mar 2006 04:27:32 pm; edited 1 time in total
Back to top
threefingeredguy


Advanced Member


Joined: 01 Sep 2005
Posts: 479

Posted: 15 Mar 2006 04:24:50 pm    Post subject:

There isn't one now, but I had been making a sort of MMO game. It's way to slow though. This page was my inspiration http://web.okaygo.co.uk/apps/letters/flashcom/.
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 15 Mar 2006 04:33:55 pm    Post subject:

Are you still working on that game? What kind of game is it?

I'm always looking for people to work on projects with, so if you want to make some sort of flash game with me, let me know.

Here's a new version, where the ninja has a trail of one pixel. I think it looks better this way, and I can't tell the difference in terms of speed! So try it out. Changes are in bold.

Walls should be at least two pixels thick for consistent collision detection.
M - vertical position, always an integer
N - horizontal position, always an integer (N for Ninja)
O - old M
P - old N
U - vertical velocity, floating point number
V - horizontal velocity, floating point number (V for Velocity)

M\->\O
N\->\P

Repeat K=45
getKey\->\K
If Vpxl-Test(M,N+1-2(V<0
Then
V/abs(V)(.1-1.1(K=21))+(Ans=26)-(Ans=24\->\V
1-3(K=21\->\U
Else
If pxl-Test(M+1,N
Then
.6V+(Ans=26 and V<2)-(Ans=24 and V>-2\->\V
-2.5(K=21\->\U
Else
.8V+.5((Ans=26 and V<2)-(Ans=24 and V>-2\->\V
U+.25((U<2)+(U<0 and not(iPart(Ans\->\U
End
End
Pxl-Change(O,P
M\->\O

iPart(Ans+U+.5
Ans-pxl-Test(Ans,N)((U\>=\1)-(U\<=\-1\->\M
N\->\P
iPart(Ans+V+.5
Ans-pxl-Test(M,Ans)((V\>=\1)-(V\<=\-1\->\N
Pxl-Change(M,Ans
End
Back to top
CDI


Advanced Member


Joined: 05 Nov 2005
Posts: 267

Posted: 15 Mar 2006 05:41:20 pm    Post subject:

o.o sweet, I think I copied it wrong though >.< I have to re-do it Smile mut this is awsome! will I be able to jump off walls?
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 15 Mar 2006 08:17:28 pm    Post subject:

Yes, there is wall jumping (and wall sliding). There isn't sliding down slopes yet, though. All I would have to do for that is add some code to make you slowly tip over an edge.

One thing to know about the code above is that it is just the engine code. Before you run the program, you need to set up whatever map you have, as well as the starting coordinates and velocity. I'm working on a map editor right now, which will make that automatic. Smile
Back to top
CDI


Advanced Member


Joined: 05 Nov 2005
Posts: 267

Posted: 15 Mar 2006 09:03:59 pm    Post subject:

cool, this'll be a good game Smile I'm 100% sure of it
Back to top
kalan_vod


Advanced Member


Joined: 04 Sep 2005
Posts: 446

Posted: 15 Mar 2006 11:12:35 pm    Post subject:

kalan_vod wrote:
I tried it and it wroks really good, but good thing axes were on otherwise I would've just fell Very Happy. I made it into a program so more people could try it (those who are lazy Very Happy).

CLICKY <---------CLICK NOW!!!
[post="70539"]<{POST_SNAPBACK}>[/post]

You could just download it from here Very Happy.
Back to top
CDI


Advanced Member


Joined: 05 Nov 2005
Posts: 267

Posted: 16 Mar 2006 12:08:42 pm    Post subject:

naw, link cable broke... I have to ge a new one :/

Got it to work, wow, this is impressive, I lke it ^^ I can jump off of the walls and everything... *Designes some test levels*


Last edited by Guest on 16 Mar 2006 12:30:23 pm; edited 1 time in total
Back to top
kalan_vod


Advanced Member


Joined: 04 Sep 2005
Posts: 446

Posted: 16 Mar 2006 03:18:43 pm    Post subject:

Yeah I ended up using the axes as a test level Very Happy.
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 16 Mar 2006 04:12:08 pm    Post subject:

I made a little level drawing routine using tiles, but I'm thinking that the Line() command would be better (single pixel walls are fine except as ceilings). The thing is that solid tiles are too chunky, and sloped surfaces don't work very well. I tried making slopes work, but I think that the engine is fine the way it is, and I should work within the limitations of the calculator instead of trying to make an exact clone of N!

I also tested gold and mines, but I haven't come up with a good method yet. So far I've tried putting the coordinates in lists, which isn't too slow if the list is short, but I can't really delete coordinates from the list. There are some other issues as well. The next thing I could try is using a string or matrix as a map. I would appreciate any suggestions though.

So if you have ideas for how to store and display the map (and objects) please post them here. It would be great if you could help design or test levels as well.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
» View previous topic :: View next topic  
Page 1 of 9 » All times are UTC - 5 Hours

 

Advertisement