Thursday, 08 January 2009
 
  Home arrow Forum  
Main Menu
Home
News
Forum
Documentation
Download
Links
Administrator
Login Form
Welcome, Guest. Please login or register.
January 08, 2009, 08:10:11 AM
Username: Password:
Login with username, password and session length

Forgot your password?
MORE HELP!!! AAAAAAAHHHHHHHH!
DSLua Community
Welcome, Guest. Please login or register.
January 08, 2009, 08:10:11 AM
1724 Posts in 316 Topics by 10254 Members
Latest Member: Wrollumma
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Need Help?  |  MORE HELP!!! AAAAAAAHHHHHHHH! « previous next »
Pages: [1]
Author Topic: MORE HELP!!! AAAAAAAHHHHHHHH!  (Read 819 times)
daltonlaffs
Waxing Gibbous
****
Posts: 340


Freaking Insane


WWW
« on: April 23, 2006, 05:04:41 PM »

HELP ME!

The attached file is an early copy of my sprites for multiplayer games, and the lua script that uses them. Now you see every image in WFCFrames, but on the right side of the screen is a graphic called WFCanim. I want this sprite animated with all the frames in order. 0, 1, 2, 3, 4. HURRY. PLEASE  Grin

* AllWifiSpriteStuff.zip (46.61 KB - downloaded 30 times.)
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
waruwaru
Administrator
Waxing Crescent
*****
Posts: 94


« Reply #1 on: April 23, 2006, 11:36:24 PM »

You basically want to use the Sprite:WFCanim:SetFrame() function

Code:
-- initialize global vars
SCREEN_BOTTOM   = 0
SCREEN_TOP      = 1
PALETTE_WFV    = 0

BGTopText = Screen.LoadTextBG()
Screen.Initialize( SCREEN_TOP, BGTopText )

BGTopText:PrintXY( 0, 1, "Wifi Connection sprite test 1" )
BGTopText:PrintXY( 0, 4, "Press Select to exit." )

Sprite.LoadPalette( SCREEN_BOTTOM, PALETTE_WFV, "AllWifiCon.bmp.pal" )

WFCFrames  = FrameStrip.Create( SCREEN_BOTTOM, 16, 16, "256" )

WFCFrames:LoadBin( "AllWifiCon.raw", 5 )

nCurrentFrame = 0
nCount        = 0
WFCanim       = Sprite.Create( WFCFrames, 0, PALETTE_WFV, 240, 176 )

while true do
  -- set the sprite to a specified frame
  WFCanim:SetFrame( WFCFrames, nCurrentFrame )

  -- keep track of frame count, and limit it to be 0-19
  nCount        = math.mod( nCount + 1, 20 )
  if ( nCount == 0 ) then
    -- increment frame index every 20 frames
    nCurrentFrame = nCurrentFrame + 1
  end

  -- limit frame index to 0-4
  if ( nCurrentFrame > 4 ) then
    nCurrentFrame = 0
  end

  -- exit loop when user press SELECT
  if Pads.Select() then
    break
  end

  Screen.WaitForVBL()
end

WFCanim:Free()

WFCFrames:FreeAll()
WFCFrames  = nil

Enjoy!
Waruwaru
Logged
daltonlaffs
Waxing Gibbous
****
Posts: 340


Freaking Insane


WWW
« Reply #2 on: April 24, 2006, 06:42:29 AM »

All right, thanks again!!! I kinda feel humiliated that I always have to ask for help, but there are things I just don't get yet. DSLua is a nice prog language, but you guys REALLY need some ducumentations.  Roll Eyes
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
waruwaru
Administrator
Waxing Crescent
*****
Posts: 94


« Reply #3 on: April 24, 2006, 12:33:46 PM »

Yep, I will start working on some formal documentations after I get the next release out.  Right now, it'd documentations by examples only. Smiley

Warwaru
Logged
Pages: [1]
« previous next »
    Jump to:  



    (C) 2009 DSLua

    DSLua - Best scripting language for Nintendo DS home-brew!