Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK Version 2 Alpha 8

Author
Message
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 26th Oct 2014 13:06 Edited at: 26th Oct 2014 13:11
@Paul,

when I use a UDT as a parameter for a function, is it used by reference or as a copy inside the function? I think the later one, or?

Edit: Ok found it through the forum.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Oct 2014 13:06
I think you need to use the bitwise AND, not logical AND.

-- Jim - When is there going to be a release?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Oct 2014 13:09
Is there any way to change the getpointerstate sample rate (and get pointerreleased) so it matches frame rate?

I have noticed getpointerstate and getpointerreleased do not update at every sync on Android (at least, not on my Galaxy S2 4.1.2). I'm using this command in some nice inertia scrolling which works perfectly in windows, but android thinks my finger is still on the screen meaning that getpointerx thinks my finger has stopped moving, when in actual fact my finger has left the screen. To work around it, I'm having to populate a history of getpointerstate values and look back 4 or 5 frames to see if state changed.

Thanks.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Oct 2014 14:13
Quote: "0,1,1,1,1,1,1,1,1,1,1 in the latest alpha."


That it should. Check the Principles section of the manual.

Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Oct 2014 15:37
@CJB - That issue seems to happen with a few android devices. Try using the touch commands instead.

MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 26th Oct 2014 16:38
Paul, I guess I hit a serious limitation (at least for me) in AGK2.
If I have unterstood that correctly, dynamic lists are implemented as arrays. Nothing wrong here but they don't hold references to the original UDT. So if I store UDTs inside an array, the stored UDT is a copy of the original one. It isn't stored by reference. The only dynamic thing here is that you can easily extend an array.



I have tried to build a little framework for a game. Inside the function above, I create a new UDT, store it inside a list which I can iterate later on, and also return the UDT so I can use it for direct approach. Well, it turns out that the returning UDT is not the same as the one in the list.

If you say now, return the index of the array, well it goes against the dyamic list approach. If an entry inside the array is removed, all indices after that one are off by one entry.

So what is the advantage of this so called dynamic list/array approach?
J T Huges
15
Years of Service
User Offline
Joined: 24th Oct 2009
Location: O-HI-O. USA.
Posted: 26th Oct 2014 16:52
Hey Paul,

Well, so far I have downloaded it and ran a few things and so far I must be lucky with it cause it is working ok for me.
I haven't had any problems yet.

Good work, Thanks.

Live Long -N- Rock'in Space Cowboys. The Planetary Nebula Production Co. Copyright 2014.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Oct 2014 17:36
I think you're trying to do OOP-style programming in a system which is not actually object-orientated.

-- Jim - When is there going to be a release?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th Oct 2014 17:50
Quote: "I am getting a different result when using Boolean AND between AppGameKit V108 and V2.8alpha."


That's because version 1 didn't have a boolean AND, it used bitwise AND for everything. You can use the operator && for bitwise and.

Quote: "Is there any way to change the getpointerstate sample rate (and get pointerreleased) so it matches frame rate?"


We receive updates from the device when it decides to send them, nothing we can do.

Quote: "So if I store UDTs inside an array, the stored UDT is a copy of the original one. It isn't stored by reference"


Yes, that is intended. Otherwise we get into reference counting and garbage collection, and force people to create shallow/deep copy functions for their types. Then people will ask for pointers and we'll have a language similar to C. I haven't thought about where the language should go next, or if that is a good idea.

Quote: "So what is the advantage of this so called dynamic list/array approach?"


That you can add/insert/remove items from an array without explicitly resizing it.

Quote: "I haven't had any problems yet."


It's been downloaded 195 times so I'm hoping that's the case for most people!
Rings
15
Years of Service
User Offline
Joined: 15th Sep 2009
Location:
Posted: 26th Oct 2014 19:28
The new agk player(updated yesterday) can't reached vie the broadcast from the IDE.
(Android 4.1.1 ).
Firewall is completly disabled, Win 8.1 x64

any hints what to do ?
IronGiant
AGK Bronze Backer
12
Years of Service
User Offline
Joined: 27th Feb 2012
Location: the great state of madness
Posted: 26th Oct 2014 19:35 Edited at: 26th Oct 2014 19:39
Lovin this new AGK. thanks again Paul for the mass data input for Arrays. Its' for lack of a better term, "magical".

too any that dont know, I think a continuing data line has to end in a comma to avoid an error


Now to confirm, Avast Anti-Virus does not like the new AppGameKit 2.8 compiler. On my laptop I had to shut all my Avast Shields off to keep it from erasing
my compiler for AppGameKit 2.8. I never use Avasts shields anyways, I just scan stuff as I download it.

It's Bird! , It's Plane!, No its a rocket powered Squirrel holding some acorns and a smile!
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 26th Oct 2014 21:27 Edited at: 26th Oct 2014 21:41
Damn, V7.1 ran fine on my Kindle Fire HD. V8 doesn't. The player starts but as soon the broadcast is done, it crashes. With the same games too.

Edit: Dooh, I installed the old version again. Stupid me.
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 26th Oct 2014 21:52
@Paul,

on OSX 10.8.5, if you want to paste a text inside the FIND or Replace dialog, it will paste it inside the coding area instead.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 26th Oct 2014 23:47 Edited at: 26th Oct 2014 23:50
couple bugs to report on ouya

-keyboard buttons f1-f12 do not work as far as i can tell
-mouse z (roller wheel) does not work
-right mouse click acts as if it was a left mouse click
-middle button click also acts as if it was a left mouse click

this is when i plug a usb mouse into the ouya and have a bluetooth keyboard connected to it aswell.

JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 27th Oct 2014 12:21
Quote: "@JohnnyMeek, this happened to me, but only because I accidentally installed V2 over V1 by accepting the default location during installation. A quick install of V1 sorted that out, followed by an install of V2 to another location.

As has been stated, the problem with the missing compiler is due to anti-virus software. Again, this happened to me. Another re-install, this time without the antivirus software, solved the issue."


I did install to a different location. It's as though some environment variable is being changed?
Native Tech
11
Years of Service
User Offline
Joined: 19th Jul 2013
Location:
Posted: 28th Oct 2014 10:10
Having a small issue with #CONSTANT

I am defining it like this


rx = 640
ry = 480
#CONSTANT X_MIN = rx*0.2
#CONSTANT X_MAX = rx
#CONSTANT Y_MIN = ry*0.15
#CONSTANT Y_MAX = ry-Y_MIN


and then using it here:





bsize = Y_MAX-Y_MIN



But I get an error saying:

main.agc:55: error: Variable "y_min" is used without being defined or initialised



here is the entire source

[/code]
rx = 640
ry = 480

#CONSTANT X_MIN = rx*0.2
#CONSTANT X_MAX = rx
#CONSTANT Y_MIN = ry*0.15
#CONSTANT Y_MAX = ry-Y_MIN

SetWindowSize( rx, ry, 0 )
SetVirtualResolution( rx, ry )



//------------- SETUP---------------------
GLOBAL SOUND_COUNT as integer


LoadSound(1,"hat.wav")
LoadSound(2,"kick.wav")
LoadSound(3,"Snare.wav")

SOUND_COUNT = 3

GLOBAL dummy_empty
GLOBAL dummy_full


TYPE SEQUENCE
BPM as integer
BARS as integer
RESOLUTION as integer
TOTAL_STEPS as integer
BUT_SIZE as integer
ENDTYPE


SEQ as SEQUENCE

SEQ.BPM = 100
SEQ.BARS = 4
SEQ.RESOLUTION= 16

bsize as integer

bsize = Y_MAX-Y_MIN
newsize = SEQ.BARS*SEQ.RESOLUTION
SEQ.TOTAL_STEPS = newsize
SEQ.BUT_SIZE = bsize/4



//--------- END SETUP



button_emptyID = LoadImage("button_empty.png")
button_fullID = LoadImage("button_full.png")
button_playingID = LoadImage("button_playing.png")
button_loadID = LoadImage("button_load.png")



TYPE ROWS
TopOf as integer
BottomOf as integer
SprID as integer
SoundID as integer
ENDTYPE

TYPE COLUMNS
LeftSide as integer
RightSide as integer
BeatIndex as integer
ENDTYPE



GLOBAL ROW as ROWS[]
ROW.length = SOUND_COUNT

GLOBAL COL as COLUMNS[]
COL.length = SEQ.TOTAL_STEPS

//--------- END STRIP


do
print ("SEQ.button size = :"+str(SEQ.BUT_SIZE))
sync()
loop
[code]

Native Technology
Native Tech
11
Years of Service
User Offline
Joined: 19th Jul 2013
Location:
Posted: 28th Oct 2014 10:12
Whats also strange is if I comment out all lines using Y_MIN I get the exact same error

main.agc:104: error: Variable "y_min" is used without being defined or initialised


but it is now putting at a line where Y_MIN is not even being used????

Native Technology
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 28th Oct 2014 10:15
Looks to me like you're trying to assign a float to an integer.

-- Jim - When is there going to be a release?
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 28th Oct 2014 11:00
Native Tech:
You can't use a variable in a constant declaration.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 28th Oct 2014 15:53
Quote: "#CONSTANT Y_MAX = ry-Y_MIN"


You can't have a constant within a constant.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 28th Oct 2014 22:07
@Paul

Ok, so I've FINALLY gotten around to downloading the beta, and so far I have to say the new editor is looking good. But.....straight off the bat, the editor only seems to pick up about half of the arrays that I've dimensioned in the list at the side, screen shot attached.

After some playing, I've discovered that putting anything after the declaration and then using // to rem it out seems to stop the variable from being recognized in the list.

I know, it's a little thing but it looks sloppy if you guys are going for Steam.[img]null[/img]

Attachments

Login to view attachments
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Oct 2014 00:52
GetMultiTouchExists() in 7.1 reports 1 on a Windows 7 PC...

JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 29th Oct 2014 09:02
If I install V2 (to a unique location) I can't compile V1 with V1 IDE.

This is really annoying. I have to reninstall V1 for it to work again. I'm guessing this is some kind of env variable.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 29th Oct 2014 09:16
Quote: "GetMultiTouchExists() in 7.1 reports 1 on a Windows 7 PC...
"


This happens in Windows 8.1 as well, however GetRawTouchCount(1) will still report 0 if using mouse.
Retrific
10
Years of Service
User Offline
Joined: 26th Aug 2014
Location: Horwich, UK
Posted: 29th Oct 2014 10:58
@JohnnyMeek, you should be able to compile with the V1 IDE without any problems. Are you getting any particular error?
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 29th Oct 2014 11:54
Windows 7 has multi-touch capabilities. It has no way of knowing if the monitor has.

-- Jim - When is there going to be a release?
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 29th Oct 2014 16:52
Quote: "- Fixed DeleteTween causing a crash on Android"


The following script stops the app responding, happens on a compiled Windows exe, broadcasting to android or as an apk running on Android. Not sure if it's related to the above or just bad coding on my part but see for yourself, run script then press space bar once the sprites are moving.



Paul, AGK2 is a fantastic leap forward, so thanks for all your efforts.

"It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
Ranietz
AGK Gold Backer
20
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 29th Oct 2014 17:30
I'm not sure if this has already been mentioned but there seems to be a bug with the code-folding in the IDE. If the code that should be folded is on a single line it wont work properly. It seems like it doesn't know where to end the folding so it folds all the code from that line.

Example:


Maybe it's not a good practice to write code like this but it will in some cases improve readability.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Oct 2014 17:44 Edited at: 29th Oct 2014 18:08
Quote: "I've discovered that putting anything after the declaration and then using // to rem it out seems to stop the variable from being recognized"


Fixed for the next version. Incidentally if your declaration includes "as integer" or similar then the current version will accept a comment at the end, which could be used as a workaround.

Quote: "If I install V2 (to a unique location) I can't compile V1 with V1 IDE."


It looks like the installer overwrites a registry path for version 1, but I don't know if that affects version 1 compiler path. In any case you should be able to correct it in the version 1 settings by specifying the actual compiler path. I'll fix the version 2 installer to use a different registry entry for the next version.

Quote: "The following script stops the app responding, happens on a compiled Windows exe, broadcasting to android or as an apk running on Android."


Thanks for the code, fixed for the next version.

Quote: " If the code that should be folded is on a single line it wont work properly."


Unfortunately I can't see an easy way to fix that.
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 29th Oct 2014 18:13
Quote: "Quote: "The following script stops the app responding, happens on a compiled Windows exe, broadcasting to android or as an apk running on Android."

Thanks for the code, fixed for the next version."


Thanks Paul.

"It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Oct 2014 20:55
@xcept & Jim
Sooo... then the command will likely report 1 for Mac too...
Which means it will report 1 on all platforms that AppGameKit supports which makes it useless... Or am I nuts?

JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 29th Oct 2014 22:05
I'll report back on this.

-- Jim - When is there going to be a release?
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 29th Oct 2014 22:52
Quote: "Sooo... then the command will likely report 1 for Mac too..."


No, it doesn't. No Multitouch on my Imac, which I expected. OSX 10.8.5.
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Oct 2014 23:21 Edited at: 29th Oct 2014 23:32
So.. on Windows 7 desktop PC with clearly no touch input devices it returns true. On a Mac laptop with no touch input devices it returns false. Seems like the command is still not useful. Back to just using a check at the raw input commands.

EDIT:
Looks like this is the same in v1... So I guess it is intentional, I just apparently never noticed or used the command. Or maybe I did and found it not useful. Anyway, not sure if Paul can make it better or even cares to. At this point I don't care, I just found it odd and thought that it should be reported.

JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 30th Oct 2014 00:13
Naphier - I agree with you. Unless the device can return a query for multi-touch the result may be misleading.

Delphi has very advanced touch and gesture capabilities. I'll have a look tomorrow.

-- Jim - When is there going to be a release?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Oct 2014 01:59
Quote: "So.. on Windows 7 desktop PC with clearly no touch input devices it returns true."


Currently (and after a lot of searching) I don't know of a way of detecting a touch input device in a non-metro app, so I have to assume that Windows 7 and Window 8 are touch enabled. If you know of a way of doing it in C++ then please let me know and I will add it in.

Same with Mac I currently assume it doesn't have touch, but I haven't researched that one much, and I can't test it anyway. As far as I'm aware touch screens on Macs isn't a thing yet?
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 30th Oct 2014 02:24
Would this do it?
http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.input.touchcapabilities.touchpresent.aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-1
I'm not all that concerned about it because my input methods look for raw touch input, just found it odd that this command was present, but didn't really do what I thought it would.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Oct 2014 02:55
Unfortunately that's only for Windows 8 RT (metro) apps.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 30th Oct 2014 03:05
paul... is there something different with transparency on png files?

i loaded my project for the first time on a mac pc and the black area on my png files are not being transparent. when i load the same project onto my windows pc everything expected to be transparent is.

is apples main transparent colour white? or something else by default?

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Oct 2014 03:41
No changes that I can remember. I will need to see the image file and the code used to load it.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 30th Oct 2014 04:05
Paul,

Just a great thanks for all these V2 alpha versions.

You're doing an amazing job !

Keep it up !

--------------
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 30th Oct 2014 06:31 Edited at: 30th Oct 2014 17:03
sorry i can't write up an example at the moment as i have completely switched over to apple and my windows pc is dissassembled and don't have the tools installed for editing pictures. [i will hook it back up]

from what I've been able to test is that i can't get any transparency to show at all with any image on my mac and the images worked fine on windows and ouya.

I will send you an example afterwork tomorrow illustrating my problem.

Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 30th Oct 2014 09:55
Why not just ask the user if he has a touch enabled device, either at start up, or as a configurable item in a settings menu?

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 30th Oct 2014 10:23
The latest version of Delphi (XE7) has very good touch support. Interestingly, the documentation states that multi-touch is an OS feature and is there on Windows 7&8 or later, Mac, iOS and Android.

What Paul could do is return false if the OS is Windows and the version XP or lower.

Delphi sends different messages when the input is mouse or touch. That means you could have the user either click or tap when the program is first run and act appropriately.

-- Jim - When is there going to be a release?
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 30th Oct 2014 12:34
Quote: "Delphi sends different messages when the input is mouse or touch. That means you could have the user either click or tap when the program is first run and act appropriately."


In AGK:

GetRawTouchCount(1) would show a touch event

and

GetRawMouseLeftPressed() would show a mouse click

My hovercraft is full of eels
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 30th Oct 2014 16:54
It would be so easy to check when the user hits start

Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 30th Oct 2014 20:33
It is! I just have it in my input controller. if touchCount > 0 then do the touch input, else check for pointer presses. Very simple. Again, I just found that command and thought it was new and would give good info. I think since it doesn't it might be better to deprecate it.

SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 31st Oct 2014 00:15
sorry bout 2 posts but I'm just learning how to use my mac

here is the zip file of my code not showing transparency on background on my mac. same code works fine on windows

Attachments

Login to view attachments
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 31st Oct 2014 00:16 Edited at: 31st Oct 2014 00:21
and the actual image on my mac screen.... should have white shinning through


here is my system spec:

mac mini (late 2009)
2.26ghz core 2 duo
4gb ddr3 ram
nvidia geforce 9400 256mb
os 10.10

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st Oct 2014 02:02
Quote: "What Paul could do is return false if the OS is Windows and the version XP or lower."


It should already do this but I haven't tested it in a while.

Quote: "here is the zip file of my code not showing transparency on background on my mac. same code works fine on windows"


Thanks, fixed for the next version.

Login to post a reply

Server time is: 2024-11-25 13:39:11
Your offset time is: 2024-11-25 13:39:11