xboxscene.org forums

Author Topic: Expression Goodness  (Read 779 times)

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Expression Goodness
« on: June 21, 2004, 11:33:00 AM »

Gotta love em.

CODE
SetFunc ScriptPath FNPath %0%

LoadImage XBOX %ScriptPath%\ttt-o.png

:REFRESH
BeginDraw
Set gL 100
Set gT 100
Set Size 100
Set Gap 2

For L = 0 To 2
  For T = 0 To 2
     Image XBOX %(L*(Size+Gap)+gL)% %(T*(Size+Gap)+gT)% %Size% %Size%
  Next
Next
EndDraw

DelayMS 4000


Creates a nice little tictactoe board

This post has been edited by flattspott: Jun 21 2004, 06:43 PM <
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Expression Goodness
« Reply #1 on: June 21, 2004, 10:50:00 AM »

part of the clock script

CODE
   Set ts $TM_Seconds$
   Set angle %(ts*6*pii/180)%
   Set xPos %(#sin(angle))%
   Set yPos %(#cos(angle))%
   Line %ClockLeft% %ClockTop% %(ClockLeft+ClockWidth/3*xPos)% %(ClockTop-ClockHeight/3*yPos)% 0xAA000000

   Set tm %($TM_Minutes+$TM_Seconds/60)%
   Set angle %(tm*6*pii/180)%
   Set xPos %(#sin(angle))%
   Set yPos %(#cos(angle))%
   Line %ClockLeft% %ClockTop% %(ClockLeft+ClockWidth/3*xPos)% %(ClockTop-ClockHeight/3*yPos)% 0xAA000000

   Set th %($TM_Hours+$TM_Minutes/60)%
   If# %th% > 12 Then
 Set th %(th-12)%
   EndIf

   Set angle %(th*30*pii/180)%
   Set xPos %(#sin(angle))%
   Set yPos %(#cos(angle))%
   Line %ClockLeft% %ClockTop% %(ClockLeft+ClockWidth/4*xPos)% %(ClockTop-ClockHeight/4*yPos)% 0xFF000000


Insane stuff here biggrin.gif

Edit:

dl here
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Expression Goodness
« Reply #2 on: June 21, 2004, 01:48:00 PM »

Nice.

Although %($Rand%10)% still doesn't seem to be working right for me at least. It keeps returning a value of 0. Anyone else?

This post has been edited by flattspott: Jun 21 2004, 08:49 PM <
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Expression Goodness
« Reply #3 on: June 21, 2004, 01:57:00 PM »

%($rand%10)% works.  Apparently it's case sensitive.  <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Expression Goodness
« Reply #4 on: June 21, 2004, 02:02:00 PM »

Well what do you know...

Anywho I just loaded up the clock, needless to say I'm impressed.

However it doesn't seem to work right.

The captions says 2:48pm ...Moving. Yet the analog time says it's 12. The second hand moves but the hour and minute hands never do.  <
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Expression Goodness
« Reply #5 on: June 21, 2004, 02:27:00 PM »

Yeah, all the TM_* specials are case sensitive (something bj should look into), and need to be lower case.

It was working fine before, but I made a few changes and then posted it, so it didn't work anymore.  <
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Expression Goodness
« Reply #6 on: June 21, 2004, 03:33:00 PM »

Yeah, I'll check that and make sure they aren't checking with case.  <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Expression Goodness
« Reply #7 on: June 21, 2004, 03:45:00 PM »

Here something interesting I did

CODE

// FLASHBANG
SetState Blank

For X = 1 To 100
  For I = 0 to 3
     SetFunc C%I% CvtToBase 16 2 %($rand%255)%
  Next
  Set Color 0x%C0%%C1%%C2%%C3%
  Gosub REFRESH
Next

:REFRESH
BeginDraw
  Box 0 0 640 480 %Color% %Color%
EndDraw
DelayMS 300
Return
 <
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Expression Goodness
« Reply #8 on: June 21, 2004, 03:48:00 PM »

QUOTE (flattspott @ Jun 22 2004, 12:51 AM)
Well what do you know...

Anywho I just loaded up the clock, needless to say I'm impressed.

However it doesn't seem to work right.

The captions says 2:48pm ...Moving. Yet the analog time says it's 12. The second hand moves but the hour and minute hands never do.

BTW, the "moving" means pressing up/down/left/right will move the clock (holding right trigger will move it faster, analoguely (just an experiment))
And pressing A changes it to resize, which lets u resize the clock.  And pressing X makes it into a circle, if it's elliptical after you resize.  <
Logged