![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Basic4ppc Wishlist Missing any feature? |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I use square sprites without any transparency and have never noticed anything odd. They move constantly.
If moving to x,y would this routine need to be called for every movement and will it slow it down (if the artefacts are present)? A question for your experience and knowledge of how sprites work. I know this can be done outside the sprite, but could there be any advantage, speed wise or any other way, if a sprite had a destination property (dX,dY) such that the sprite would automatically travel toward it and upon arrival trigger an event? My thinking is that in this way the testing of each pixel position passed would be by internal code rather than user (external) code.
__________________
You never stop learning until you die. Sometimes I think I am dead. Sometimes others think I am dead! |
|
||||
|
Trust me
, between versions 1.21 and 1.25 there was a problem even if you didn't notice it. I don';t know if it was in earlier versions but I have changed a lot of the library internally and am not going back to find out!Quote:
Quote:
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. Last edited by agraham : 07-03-2009 at 07:42 PM. |
|
||||
|
Quote:
Version 1.27 changes are as follows. GameWindow has a new CollisionDestination event. Sprite has new IsAnimated, DestinationX, DestinationY and HasDestination properties. There is a help file describing the changes in the archive.
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. Last edited by agraham : 07-04-2009 at 06:28 PM. |
|
|||
|
I am having difficulty with the data array but it must be me.
Quote:
I tried Dim Type(x,y)SpriteData(4) which is OK but Sprite.DataArray = Spritedata() gave the error... Object of type 'System.String[,]' cannot be converted to type 'System.String[]' Can you advise please [Edit]The destinations work a treat!!
__________________
You never stop learning until you die. Sometimes I think I am dead. Sometimes others think I am dead! Last edited by enonod : 07-06-2009 at 08:40 AM. |
|
||||
|
Quote:
Quote:
EDIT:- The occurrence of the "cannot be converted error" implies that the "Dim SpriteData(4)" statement is not being executed before "Sprite.DataArray = Spritedata()" as that converts it back to a one dimension array. Looks like the execution sequence is wrong. Each Sprite needs its own array. If you don't re-Dim it for each Sprite they will share the same array - which you might or might not want to do, most likely not!
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. Last edited by agraham : 07-06-2009 at 09:14 AM. |
|
|||
|
Yes I did have both Dim's in Globals Sub. My problem is one of comprehension. I cannot seem to get to grips with this 'sort of indirection' or 'temps' that we mentioned earlier, instead of direct.
I don't see why each of the Type(x,y,z) doesn't become one entity and then placed in a single dimension. I am trying to assign points((2,3),(3,7)...) to a sprite. That is why I did what I did. I cannot seem to translate that using the example. Sorry to be thick but perhaps I could ask for your help on that specific problem? [Edit] I also tried in app_start... Dim points(4) Points(0).x= 49 Points(0).y=1 [Edit 1] The example line 35 'seems' to only permit one array element of x,y,z but it is dimensioned for 3, how to add Data(1)?? In the example line 24 I don't see why... & CRLF & "Array(1) = " & arr(1)) cannot become... & CRLF & "Array(1) = " & spr.DataArray(1)) Is it for the same reason as Spr.Value = Spr1.Value ? [Edit 2] It looks to me that x,y,z have been converted to data(0)=x,...(1)=y etc. Which means that there is only one true element permitted as I mentioned above so... Spr.DataArray = data() where data is as above
__________________
You never stop learning until you die. Sometimes I think I am dead. Sometimes others think I am dead! Last edited by enonod : 07-06-2009 at 12:16 PM. Reason: Dim points(4) |
|
||||
|
A structure is a short hand for one dimension of an array to make access to elements of the array more intuitive
Code:
Dim Type(x, y, z, name)Data ... Data.x = 0 Data.y = 1 Data.z = 2 Data.name = 3 Is equivalent to Dim Data(4) ... x = 0: y = 1: z = 1: name = 3 Data(x) = 0 Data(y) = 1 Data(z) = 2 Data(name) = 3 Code:
Dim Type(x, y, z, name)Data(2) ... Data(0).x = 0 Data(0).Y = 1 Data(0).z = 2 Data(.).name = 3 Is equivalent to Dim Data(2,4) ... x = 0: y = 1: z = 1: name = 3 Data(0,x) = 0 Data(0,y) = 1 Data(0,z) = 2 Data(0,name) = 3 Code:
spr1.Value = gw.Sprite1 Data() = spr.DataArray sprname = Data.name ' or sprname = Data(3)
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Assembly properties | Pachuquin | Questions & Help Needed | 1 | 05-05-2009 06:42 PM |
| Compiled Properties | Zenerdiode | Basic4ppc Wishlist | 4 | 03-06-2009 09:54 PM |
| Properties module - useful module for working with properties / ini files | Erel | Code Samples & Tips | 0 | 11-07-2008 09:01 PM |
| Evaluate properties | Offbeatmammal | Basic4ppc Wishlist | 0 | 06-02-2008 07:23 AM |
| More properties for panels | RandomCoder | Basic4ppc Wishlist | 0 | 07-12-2007 09:48 PM |