-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|433|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




spinal

gui confusion

8th April 2021

Current conundrum....

Switching from 'add new colours to palette' to 'use a fixed palette'

[code]
Local closestMatch:Int = 0
Local colourDistance:Int = 256+256+256 ' out of range
Local r1:Int = ((rgb565 Shr 11) & 31) &#*snip*


spinal

SpinalWatch

8th March 2021

Introducing...
[code]
_________ __ __ __ __ .__
/ _____/ _____________/ |_/ \\ / \\_/ |_ ____ | |__
\\_____ \\ / \\_ __ \\ __\\ \\/\\/ /\\ __\\/ ___\\| | \\
/ \\ Y Y \\ | \\/| | \\ *snip*


spinal

SpinalWatch

8th March 2021

Python! - Everyone uses python these days, and there are existing examples of transferring data to an arduino...!!!

Nope.

Installed Python, installed pyserial library...

[code]
Traceback (most recent call last):
File ''F:\\arduino-digital-p*snip*


spinal

SpinalWatch

6th March 2021




spinal

Image rotation?

19th February 2021

I've got most of it figured I think...
Any degree,
[code]
Graphics 640,480,0,2
Graphics 320,240,0,3
SetBuffer BackBuffer()

pic = CreateImage(120,12)
SetBuffer ImageBuffer(pic)
Color 255,0,0
Rect 0,0,120,12,1
Color 0,0,255
Text 0,0,''AB*snip*


spinal

gui confusion

5th February 2021

about 5 seconds after I posted I gave that a try, that's the problem with switching languages, you forget things like
[code]
for(int y=0; y<tileSize; y++)
[/code]
is not the same as
[code]
for local y:int=0 to tileSize
[/code]

I've don*snip*


spinal

gui confusion

5th February 2021

Oh, this one is fun!

[code]
Const tileSize:Int = 8
Local tempArray:Int[(tileSize+1)*(tileSize+1)] ' make bigger than i need just in case
Local tempArrayFlip:Int[tempArray.Length][/code]

[code]
For Local y:Int = 0 To tileSize
For Local x:I*snip*


spinal

gui confusion

29th January 2021

Getting there!, the code is a mess though.

[thumb]https://socoder.net/uploads/124/2021/04/map_program_test.png[/thumb]

[code]
'
' 8888ba.88ba a88888b. dP *snip*


spinal

gui confusion

28th January 2021

Full code, in case I'm doing something correct somewhere :-P

The idea at this stage, is load a scenery image, then load a background layer, click the transparent colour button, followed by a click on the image somewhere and that colour should become*snip*


spinal

gui confusion

28th January 2021

I'm attempting to pick a colour from a loaded image.
Surely the following should work? -- nope...

[code]SuperStrict

Graphics 640,480

Local screenpixmap:TPixmap = CreatePixmap(1,1,PF_RGBA8888)
SetColor 255,0,128
DrawRect 0,0,20,20
Flip

W*snip*


spinal

gui confusion

28th January 2021

hmmm, this returns -16777216 :-(

[code]
Function GetPixel:Int(pixelX:Int, pixelY:Int)
Local screenpixmap:TPixmap = CreatePixmap(1,1,PF_RGBA8888)
screenpixmap = GrabPixmap(pixelX, pixelY,1,1)
Return ReadPixel(screenpixmap,0,0)
End Function
[/co*snip*


spinal

gui confusion

26th January 2021

That makes a bit more sense. Now to kick myself up the arse and make it do something!

[code]
SuperStrict

Import MaxGui.Drivers



'main window
Local MyWindow:TGadget
Local wwidth:Int=800
Local wheight:Int=600
Local wx:Int=(ClientWidth(De*snip*


spinal

gui confusion

26th January 2021

I was looking at blitzmax for creating a nice windows application with buttons etc.
I have strung a couple of examples together to see if I can figure out whats going on, and well, i can't.


[code]
Import MaxGui.Drivers

Local window:TGadget
L*snip*


spinal

javascript array problem [solved]

22nd July 2020

hmmm, I seem to be generating valid tiles and map, including flipped tiles (probably, not fully tested with my renderer) but I seem to be messing up on my flip array :-(

[code]

<html>
<title>Map reConstructor</title>
<style t*snip*


spinal

javascript array problem [solved]

17th July 2020

dammit, it's a pointer.

[code]
function checkTile(thisArray){

console.log(''tileArray.length'', tileArray.length);
if(tileArray.length==0){
tileArray[0] = new Array();
for (i = 0; i < thisArray.length; i++) {
tileAr*snip*


spinal

javascript array problem [solved]

17th July 2020

In fact, changing the checking routine to only the following

[code]
function checkTile(thisArray){

console.log(''tileArray.length'', tileArray.length);
if(tileArray.length==0){
tileArray[0] = new Array();
tileArray[0] = thisArr*snip*


spinal

javascript array problem [solved]

17th July 2020

Having looked around, I could not find a version of maprecon (you know it, its a tile map creator) with some extra features I want, so I made a start at my own version in javascript.

However, I seem to be having trouble comparing two arrays. The code fi*snip*


spinal

finding font widths?

2nd November 2019

Here's a small bit of code, it takes an image of a character set, pops it into a new single character width image (not really needed) and attempts to find out how wide each character is. Thing is though, it doesn't work.
Weirdly inside the x loop,*snip*


spinal

Sine of Ints

22nd October 2019

Closer, player seems to fall through the ground more, but does fly a bit...

[code]
Graphics 440,352,0,2

Cls

Global numHills = 200
Global hillMin = 40
Global hillMax = 176-40
Dim hillTops(numHills)
Global offsetX = 0;
Global hillWidth = 48*4;*snip*


spinal

Sine of Ints

21st October 2019

Still doesn't 'jump' off the hills, just falls :-( This is one of those things where I think I know how to do it, but I just don't know how to do it :-(

o Increase player speed by gravity
o Apply gravity to player
o If player hits g*snip*


spinal

Sine of Ints

20th October 2019

hmmm, not right....
[code]
Graphics 440,352,0,2

Cls

Global numHills = 200
Global hillMin = 40
Global hillMax = 176-40
Dim hillTops(numHills)
Global offsetX = 0;
Global hillWidth = 48*4;
Global fps
Global groundMidPoint = 0.0

Global GRAVIT*snip*


spinal

Sine of Ints

20th October 2019

hmmmm, this seems a little less accurate on higher angles than I expected. Have I done something wrong do you think?


[code]
Graphics 440,352,0,2

Cls

Global numHills = 200
Global hillMin = 40
Global hillMax = 176-40
Dim hillTops(numHills)
Gl*snip*


spinal

Sine of Ints

18th October 2019

OK, it seems to work, but I can't imagine why it would be son incredibly slow... I'm getting an out of this world 3fps from this.

[code]
Graphics 800,600,0,2

Cls

Global numHills = 200
Global hillMin = 40
Global hillMax = 176-40
Dim hil*snip*


spinal

Sine of Ints

18th October 2019

OK, attempted to pop the code into blitz for speed of testing etc. but for some reason this no work :-(

[code]
Graphics 800,600,0,2

Cls

Global numHills = 200
Global hillMin = 40
Global hillMax = 176-40
Dim hillTops(numHills)
Global offsetX = *snip*


spinal

Sine of Ints

8th October 2019

OK, that's part 1 done! Many thinks to Jay for that!

Not sure if its the best way to produce a hilly terrain, but it looks OK :-)

[code]
Graphics 800,600,0,2

Cls

Dim cosTable(180)
;output = WriteFile(''cossine.txt'')
For t=0 To 1*snip*

More - Older Posts