xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> Is My Understanding Of Gosub Correct?, ...and about coordinates too
flattspott
post Jan 27 2004, 02:11 AM
Post #1


X-S Freak
*****

Group: Moderator
Posts: 1787
Joined: 14-April 03
From: Southern California
Member No.: 32293
Xbox Version: v1.0
360 version: v1 (xenon)



1. A GOSUB is the same thing as a GOTO only at the end of it (the gosub section you just went to) you put RETURN which takes you back where you came from.?

Is this right, cause I was examining the tetris.xas and I looks to me like that's how it's used.

2 Is there a way for me to assign both x and y coordinates to one varible? If so how should I go about doing it?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
BenJeremy
post Jan 27 2004, 02:20 AM
Post #2


X-S Elysian
*************

Group: Head Moderator
Posts: 9688
Joined: 19-July 02
Member No.: 1853
Xbox Version: v1.1
360 version: v1 (xenon)



1. You are correct. GOSUB allows you to set up local subroutines.

2. ?? I don't know why you'd want to do this.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
flattspott
post Jan 27 2004, 03:16 AM
Post #3


X-S Freak
*****

Group: Moderator
Posts: 1787
Joined: 14-April 03
From: Southern California
Member No.: 32293
Xbox Version: v1.0
360 version: v1 (xenon)



Okay, let me clarify numer 2 for you.

What I want to do is have a box act as a cursor of sorts. Depending on where it's at on the screen, when you press a button it causes another box underneath it to colorize if you will. I can't use only one coordinate cause if there are multiple rows and columns of possible blocks to be colorized it won't work.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Kthulu
post Jan 27 2004, 04:26 AM
Post #4


X-S Freak
*****

Group: XS-BANNED
Posts: 1287
Joined: 8-August 03
Member No.: 54981
Xbox Version: v1.0
360 version: unknown



if i understand you correctly, sounds kinda similar to how my virtual keyboard works. you can draw your 'box cursor' like this...

BOX %x% %y% 25 25 BLACK WHITE

when the D-pad right is pressed...

ADD x 25

D-pad left is pressed...

SUB x 25

D-pad down is pressed...

ADD y 25

D-pad up is pressed...

SUB y 25

...of course, you'll have to check for those special cases where you don't want the 'box cursor' to move any more in a certain direction...

drawing a different colored box at the same location of the box cursor when you press A (or whatever button) isn't a problem either, but getting the script to remember where to draw the 'selected' boxes after you move your 'box cursor' is. you'll prolly need some data structure to hold on/off information. will the number of possible 'selected boxes' be known before hand?

if there are only 10 possible 'selected boxes' you could have a string of ten 1s and 0s...1 meaning to draw the box, 0 meaning don't draw the box. of course, it sounds like you could use the new [] {} variable referencing for an array too. translating the 1 or 0 to a coordinate is simply a matter of math and how you want the 'selected boxes' arranged.

if your 'selected boxes' are in 2 rows of 5 each and your on/off info looks like this... "0010000000"
1 is in the 2nd position of the string (0th being the first position), so...

SelX = 2 * 25 (25 being the width of your boxes)
SelY = (2 / 6 ) * 25 (25 being the height of your boxes) (in actionscript, 2 / 6 = 0)

for "0000000010" (1 being in the 8th position in the string)

SelX = 8 * 25
SelY = (8 / 6) * 25 (8 / 6 = 1 in actionscript)

ok, this post is getting long and i should be going to bed smile.gif i hope i understood your desires and i hope didn't tell you something you already knew. i hope i actually made sense too, but if i didn't...have a look at the actionscript code of my virtual keyboard (it's on AXS). if that doesn't help, i'd be glad to help in PMs with pieces of your code smile.gif

if i'm still no help, i'll be glad to see someone else help smile.gif

This post has been edited by Kthulu: Jan 27 2004, 04:31 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 25th May 2013 - 05:29 AM