Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - FutureCow

#661
Bug Reports / Re: Crocogame
2009-Jan-04
1/2) I had just updated to 6.122 - as noted by Kosta it's that the playmusic command has been extended but the example code hasn't. Therefore it's just that the demo needs updating.
2) The problem ended up being my NVidia drivers for my graphics card (nvoglnt.dll is related to the nvidia graphics card) - I updated to the latest and I can now run the code correctly
3) My IE isn't blocked, but it may be related to my Virus Software (Trend Internet Security). I'm not concerned about it as it's only the first page that says it can't be loaded and it corrects as soon as I select a page to view, I just thought I'd point it out.

Cheers!
#662
Bug Reports / Crocogame
2009-Jan-04
A few bugs I've found in the latest version
1) Crocogame - Won't compile as PLAYMUSIC (line 475) is missing a parameter
2) Once I add either a "0" or a "1" to the PLAYMUSIC command to get it to compile and try to run it, it dies with the error "CrocoGame.exe has encountered a problem and needs to close.  We are sorry for the inconvenience."  Error details - "AppName: crocogame.exe    AppVer: 0.0.0.0    ModName: nvoglnt.dll
ModVer: 6.14.11.7516    Offset: 001b74b7"
3) When I go into help for the first time it has a "page cannot be found" error. When I click one of the topics on the left hand side, help now works.

[attachment deleted by admin]
#663
What you need to know is the player's X position, and then for that position what the height of the hill is. Obviously then Player Y = hill height X. Having a height listing for every x coordinate on your level though would take up a lot of space, not to mention being horrendously tedious to program. This is where using tiles makes your life so much easier.

Here's one way to implement it. (I appologise that this is all in pseudocode, I haven't been using GLBasic for very long so I'll end up writing something wrong if I try and write in real code. Let me know if you don't follow this or need it in real code and I'll do the conversion).

You start off with a tile number that represents the hill (eg. a gentle slope may be tile type 10)
You then have an height offset array for tile type 10 that says how high the tile is for each given offset into the tile (eg. when player is 1 pixel into the tile, height =0, when they're 2 pixels into the tile, height =1 etc)

It then becomes a simple if-then scenario to put the player in the right location, something similar to :

HeightOffsetArray[10]=0,1,1,2,2,3,3,4,4,5

Player's current X tile =  PlayerX / TileWidth
Player's current Y tile =  PlayerY / TileHeight
Players Current Tile Number = (Players Current Y Tile * number of tiles across Screen) + Players Current X Tile
Look up type of tile player is currently on based on the current tile number

if the player is currently on tile type 10 then
  Player X Offset = PlayerX mod tilesize   (ie. how far into the tile are they in the "X" direction)
  PlayerY= The Y location of the tile on the screen + HeightOffsetArray[Player X Offset]
end if

Hope that makes things a bit clearer.
#664
If I look at the bXOR section of the help file, it just references bAND. The bAND section of the document is copied below, please show me where it documents bXOR and bNOT (WITHOUT having to run the example code to figure out how bNOT and bXOR work).



bAND()

num% = bAND(num1%, num2%)
num% = bAND(num1%, num2%)
num% = bOR(num1%, num2%)
num% = bXOR(num1%, num2%)
num% = bNOT(num1%)

Performs boolean operations on integer values. The size of the numbers is 32bit.

bAND:

Binary code of num1%: 00100010
Binary code of num2%: 00100100
Binary code of num%: 00100000
Only bits that are available in num1 AND num2 will be set in num%.

bOR:

Binary code of num1%: 00100010
Binary code of num2%: 00100100
Binary code of num%: 00100110
All bits that are available in num1% OR num2% will be set in num%.

Sample:


a%=1
b%=5
IF (a>1) OR (b>1) THEN PRINT "a>5 OR b>5", 100, 100
a=125000
lobyte=a AND 0x00FF
hibyte=a AND 0xFF00
SHOWSCREEN
MOUSEWAIT



Sample:


FOR a%=0 TO 1
FOR b%=0 TO 1
  x = (a+b*2)*160
  PRINT "a="+a+" b="+b, x, 30

  PRINT "bAND="+bAND(a, b), x,  60
  PRINT "bOR ="+bOR (a, b), x,  80
  PRINT "bXOR="+bXOR(a, b), x, 100
  IF b=0 THEN PRINT "bNOT="+bNOT(a),    x, 120
NEXT
NEXT
SHOWSCREEN
MOUSEWAIT


Refs:
bNOT(), bOR(), bXOR()
#665
So to clarify
Integer : â€"2147483647 to +2147483647

Floating point : x86 - 64bit (arbitrary precision)
ARM : 32bit (arbitrary precision)

Is Boolean considered its own data type?

Can we have the data types in the next version of the documentation?
#666
Is it possible to have the section in the documentation about compiling for different platforms expanded to include the limitations of the various platforms?

I know for example it would be hard to say for a windows pc or mac what the maximum possible resolution you can use is as it's machine dependant, but I imagine for any handheld devices for example that there are only a few video modes that work.
Also, anything else that you'd need to know to compile the program you've just written for another platform - eg. maximum number of concurrent sounds, max program/memory size (where applicable), colour depth options, input devices that work on a particular device (eg. I think I read on one of the forum posts that you can simulate a touch screen on a handheld platform with mouse clicks on a pc).
#667
Can we have an extra category in the documentation for datatypes please?
ie. I'd like to easily be able to find out what range a integer, a float etc are (particularly if it changes between platforms)
It would also be good if this section of the doco showed how you define them.

My suggestion

DataTypes
- Integer
      - Range
               Windows | 0-65535 (or whatever)
               MAC | -32766 to 32767 (or whatever)
      - Declaring
               let a=1

- String
    - Range
          Windows | Maximum length 255 characters (or whatever)
          MAC | Maximum length 100 characters (or whatever)
    - Declaring
             let a$="Hello World"
     
- Float
- Boolean
- Etc

It would be good if this documenation section could also include things like declaring arrays, structs etc so you don't have to look through the whole tutorial section. (In fact, just breaking the tutorial up into each section so you can see the topics in the helpfile would be a great start!)
#668
Hi!
Would someone be so kind as to point me in the direction of the sizes of the available datatypes?

eg. is Integer -32767 to 32768 or 0 to 65535?
What's the range on a float?
Are there double integers? Double floats?
What's the maximum string length?

I guess these change between platforms, but I can't find it in the docs. Any takers?

Thanks!
FutureCow
#669
Sorry if this exists and I have missed it, but I'd like to have a global volume sound that adjusts the volume of all loaded sounds automatically.
#670
I too would like to see a STOPSOUND.
#671
Some commands are missing documentation (eg. bNOT, bXOR) and examples. It would be nice if they were documented.