TI 83/84
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWARETI 83/84

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old October 13th, 2009, 04:49 PM
YottaFlop YottaFlop is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Sep 2009
Posts: 13 YottaFlop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m
Reputation Power: 0
Obstacles

Hello again.

Code:
ClrHome
5->A
5->B
While 1
ClrHome
Output(B,A,"+")
getKey->K
While K=0
getKey->K
End
A+(K=26)-(K=24)->A
B+(K=34)-(K=25)->B
End


This creates a little cross moving around the screen, based on the arrow keys.

How can I create obstacles? I was thinking of entering their coordinates to a list, but I don't think that points (x,y) can go into a list.

So how do I go about this? And how could I have different areas to go into after going past the edge? Thanks.

Reply With Quote
  Trader Rating: 0 · #2  
Old October 13th, 2009, 09:52 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by YottaFlop
Hello again.

Code:
ClrHome
5->A
5->B
While 1
ClrHome
Output(B,A,"+")
getKey->K
While K=0
getKey->K
End
A+(K=26)-(K=24)->A
B+(K=34)-(K=25)->B
End


This creates a little cross moving around the screen, based on the arrow keys.

How can I create obstacles? I was thinking of entering their coordinates to a list, but I don't think that points (x,y) can go into a list.

So how do I go about this? And how could I have different areas to go into after going past the edge? Thanks.

You can keep it from going off the screen by changing the code below from this...
Code:
A+(K=26)-(K=24)->A
B+(K=34)-(K=25)->B

...to this:
Code:
A+(K=26 and A≠16)-(K=24 and A≠1)->A
B+(K=34 and B≠8)-(K=25 and B≠1)->B

That way it checks to see if it will go off the screen before it ever even does, and it's quicker than any other method I know.

And as for obstacles, this has always been a problem for programming onto the calculator. One known and commonly used method is using matrices.

What you can do is make a matrix size 8 by 16 to represent the homescreen (slightly different for draw/graph screen, but that's another story), then you fill it with zeroes. then you can put a 1 or 2, or really any number you want to represent your character. Then, line the edges with walls, and be sure to use a number that will be exclusive to walls in the matrix. After that, make an obstacle, and it's position an obstacle exclusive value on the matrix. When you try to move, check to see if the space is blank, then if so, move. Else, check to see if an obstacle is in the way. If so, then check to see if something is in the way of the obstacle, if not, move it, then move your own character, If there is something in the way, or if the thing in the way of your character is a wall, then don't move your character. With this method, you can also eliminate the need of added coding for in case you hit the edge of the screen, because you're boxing yourself in already. Try and make this, and then post it. If you do, I'll post how I would do it.
__________________
日本のクールだ
Ich liebe Deutsch!

TI BASIC Tutor

Reply With Quote
  Trader Rating: 0 · #3  
Old October 15th, 2009, 10:05 AM
YottaFlop YottaFlop is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Sep 2009
Posts: 13 YottaFlop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m
Reputation Power: 0
Re

Alright. I think I've got it. But as I add more (I also have an exit key, a currently static enemy that triggers Game Overs, etc.), it starts to slow down just a small bit.

Code:
ClrHome
5->A
5->B
While 1
ClrHome

#### OUTPUT OBSTACLES ####

Output(B,A,"+")
getKey->K
While K=0
getKey->K
End
A->C
B->D
C+(K=26)-(K=24)->C
D+(K=34)-(K=25)->D

If [A](D,C)!=1
Then
A+(K=26)-(K=24)->A
B+(K=34)-(K=25)->B
End
End

Reply With Quote
  Trader Rating: 0 · #4  
Old October 15th, 2009, 02:32 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by YottaFlop
Alright. I think I've got it. But as I add more (I also have an exit key, a currently static enemy that triggers Game Overs, etc.), it starts to slow down just a small bit.

Code:
ClrHome
5->A
5->B
While 1
ClrHome

#### OUTPUT OBSTACLES ####

Output(B,A,"+")
getKey->K
While K=0
getKey->K
End
A->C
B->D
C+(K=26)-(K=24)->C
D+(K=34)-(K=25)->D

If [A](D,C)!=1
Then
A+(K=26)-(K=24)->A
B+(K=34)-(K=25)->B
End
End

Here's a quick little code I made:
(Note: underscores represent space in text)
Code:
ClrHome
{8,16->dim([A]
For(A,1,8
For(B,1,16
(A=1) or (A=8) or (B=1) or (B=16->[A](A,B
End
End
2->[A](2,2
3->[A](4,8
4->[A](7,15
For(A,1,8
For(B,1,16
"_
If 1=[A](A,B
"*
If 2=[A](A,B
"+
If 3=[A](A,B
"O
If 4=[A](A,B
"E
Output(A,B,Ans
If Ans="+
Then
A->C
B->D
End
End
End
C->A
D->B
Repeat A=7 and B=15
Output(C,D,"_
Output(A,B,"+
Repeat Ans
getKey->K
End
If sum(K={24,25,26,34
Then
A->C
B->D
A+(K=34)-(K=25->A
B+(K=26)-(K=24->B
If A=7 and B=15 or not([A](A,B
Then
0->[A](C,D
2->[A](A,B
Else
If 1=[A](A,B
Then
C->A
D->B
Else
C+2(A-C->E
D+2(B-D
If E>0 and E<9 and Ans>0 and Ans<17 and not([A](E,Ans
Then
Output(E,Ans,"O
[A](A,B->[A](E,Ans
0->[A](C,D
2->[A](A,B
Else
C->A
D->B
End
End
End
End
End

Works like a charm.
Quick and to the point.
What it does is it first checks to see if you pressed an arrow key, then if so, stores it's current position into C and D. Then it finds out where it will be according to which arrow you pressed. After that, it checks first and foremost to see if it's empty or if it's the exit (E) tile. If so, it puts 2 into that point on the matrix, and then clears it's old position (on both matrix and graphically). If there is something there (other than the E tile), then it first checks to see if it's a wall. If you want to customize it to your needs, you can have it check to see if it's a tile/object that you don't want your character to move. If it's a immobile object (or wall in this case) then it reverts to it's original position. If it's a mobile object (in this case the "O" or what's supposed to be a rock or something like that), then it finds out where THAT would move, and stores that into E and Ans. If that's empty, it moves both it and your character. If it isn't empty, then again, you revert to your original position. Unlike your character, when it checks to see if the rock's new position, it checks only if it's empty, if there' anything in the new position, it unconditionally, will not move. You can change this so that if you want it to go on a panel to open a door or something like that, but try and make sure that you don't program too many different types of panels, as it will get slightly slower each time you program a new one in.

What do you think?

Last edited by MufinMcFlufin : October 16th, 2009 at 12:17 PM.

Reply With Quote
  Trader Rating: 0 · #5  
Old October 16th, 2009, 10:01 AM
YottaFlop YottaFlop is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Sep 2009
Posts: 13 YottaFlop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m
Reputation Power: 0
Quote:
Originally Posted by MufinMcFlufin
...
What do you think?


I think it's great! Is there a way to copy it into a desktop application like Notepad and convert it to a calculator program? It would be a lot easier to program in that way.

Reply With Quote
  Trader Rating: 0 · #6  
Old October 16th, 2009, 12:12 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by YottaFlop
I think it's great! Is there a way to copy it into a desktop application like Notepad and convert it to a calculator program? It would be a lot easier to program in that way.

If your OS is Vista, then you can use the program editor included in TI Connect, but as far as I know, there's not many other ways. There are online code parsers, but the last one I found didn't work, as it wouldn't do many commands or variables such as matrices correctly. (it would insert question marks instead of what I actually told it to enter)

Either that or just program it straight into the calculator. That can be quicker than trying to find a good, free code parser.

Post a link if you can find a working code parser.

Reply With Quote
  Trader Rating: 0 · #7  
Old October 24th, 2009, 08:13 AM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Sorry, accidentally posted twice, look at next post.

Last edited by MufinMcFlufin : October 24th, 2009 at 08:17 AM.

Reply With Quote
  Trader Rating: 0 · #8  
Old October 24th, 2009, 08:16 AM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Hey, found the old code parser I used to use if anyone wants it.
I wouldn't recommend it for taking the text and making it into a program file, but if you want to look at your program with a much bigger screen, or with colored syntax, or indents so you know which End goes to which For(, While, Repeat, or Then, it's decent. It does have a optimization thing, but again, I wouldn't recommend that either, as for For( loops, if the start is 1, then it takes away the 1, and that'll get you a syntax error.

Anyways, here's that code parser. You don't need an account at the website to use it, but if you want to save your programs onto the website (which you can so you can view them where ever you have internet access) you'll have to make one. But it's free so no problem.

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWARETI 83/84 > Obstacles


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
     
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek