Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411753 Posts in 69409 Topics- by 58460 Members - Latest Member: s-games

May 24, 2024, 11:21:46 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Holding Animation-Data in a Python-File
Pages: [1]
Print
Author Topic: Holding Animation-Data in a Python-File  (Read 1213 times)
Alfonso Crawford
Level 0
**


View Profile
« on: July 23, 2009, 12:02:55 PM »

I've been thinking of using python itself as a loading-script, instead of having Python load from data-files. My problem is that I don't know how to delete modules that hold sprite-data, when I don't need the data.

Any suggestions?
Logged
Triplefox
Level 9
****



View Profile WWW
« Reply #1 on: July 23, 2009, 03:32:38 PM »

Check out eval() and execfile().
Logged

george
Level 7
**



View Profile
« Reply #2 on: July 23, 2009, 04:53:54 PM »

My problem is that I don't know how to delete modules that hold sprite-data, when I don't need the data.

Though I'm curious why you need to delete the modules at all, what about importing a list and then just removing() from the list?
Logged
Alfonso Crawford
Level 0
**


View Profile
« Reply #3 on: July 23, 2009, 06:55:25 PM »

This is basically what a loader-module will look like:

Code:
from Animation import Frame


animframe1 = Frame(1, 2, 3)
animframe1.next = "jump6"

animframe2 = Frame(4, 5, 6)
animframe2.next = "frame1"

But, if the animation-data is no longer at all necessary, how do I get rid of it?
Logged
george
Level 7
**



View Profile
« Reply #4 on: July 23, 2009, 07:30:29 PM »

sorry, I'm a little confused...by animation-data do you mean the frame image, like 'jump6' is the 6th frame of the jump animation? Do you have a case where the animation must proceed without that frame included in the animation?
Logged
Alfonso Crawford
Level 0
**


View Profile
« Reply #5 on: July 23, 2009, 07:37:37 PM »

Oh! My apologies. The animation-data I'm referring to is just the procedural data, such as frame-duration and a few physical properties. A separate graphics-system will handle image-loading, when I get that far.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic