114 Forum Posts by "mikeMarek"
I'm developing a sort of DNA-like graphics drawing and I'm trying to use a scale to make objects appear in an out of the screen. Using a cos() or sin() function, returning an interval of <bold>[-1, 1]</bold>, I'm trying to transpose that interval over to one such as <bold>[0.5, 2]</bold>, which I can then set my scaleX and scaleY values of my movieclips accordingly.
Is there any sort of mathematical representation I can use to represent this? Such as incorporating inter minimum and maximum values? Thanks for any help on the matter,
- Mike
HAHAHAHAHAHHAHAHAHAHAHHA
You guys aren't gonna fucking believe this....
It had to do with the LITERAL naming of the class...
I changed the class name to Mathz (you know, because every cool mathematician spells with a Z) and it worked like a charm... I swear to God if I ever meet the designer of AS3 I'm gonna punch him it the skull...
So, I guess you could say this thread is RESOLVED.
Thanks for those two posts ProfessorFlash and egg82, sending good vibes your way :)
Cheers,
Mike
@ProfessorFlash: It's not the pathing that's wrong; I tried calling non-static methods from a completely different class located in the same path, and it works fine.
@egg82: I'm Canadian, I only used Maths since it's similar to Math and it keeps naming conventions pretty easy to remember lol. I thought the same thing upon creating the class though, "let's use American spelling convention for this!"
The Google page, however, had every link purple'd out except the first link haha. I already skimmed through most of them lol. I will try wording everything differently in some future searches, so thanks for the hint.
Love the signature btw, same reason I became a programmer :3
I'll re-post this as SOLVED if I ever do figure this out... Thanks for the couple of posts though! Quick responses, you guys are great!
...I can't believe I'm posting this... Sorry for the relatively "simple" question, but here goes.
So, I've been using a static class called Maths that contains my own mathematical functions (such as significant figure rounding, angle and distance functions, etc.). I made it static for the same reasons AS3 makes it's Math class static; to avoid declaring a class instance to reference internal functions.
My troubles arise when I reference these static functions inside of another class. They work perfectly fine when called upon the stage:
//this is on the stage/Document class
import engine.utils.Maths;
trace(Maths.FOOBAR());
Yet do not work when called upon inside of my own classes:
//this is in a custom class
package engine
{
import engine.utils.Maths;
public class Shapes
{
public function Shapes():void
{
trace(Maths.FOOBAR());
}
};
};
And yet, oddly enough again, works perfectly fine when using FlashDevelop, but when making small demo projects in Flash itself, gives me the ever fruitful error message:
1061: Call to a possibly undefined method FOOBAR through a reference with static type Class.
I've really stumped myself here... No amount of Google could help me... I would appreciate any help you guys could offer, or alternative solutions suggested.
Again, thanks a lot Newgrounds community, you're always so helpful and friendly :)
Best regards,
Mike
Wow. Am I dumb or what?
So, I guess we could mark this thread as RESOLVED.
The problem was within the linkage. I have my main game engine folder I am working on, for now contained in folder 'engine,' and all user-created classes go into 'instance'.
I was setting the movieclip linkage as "engine.Player" and not "instance.Player" so Flash automatically created a class for me in the 'engine' folder that was empty, instead of wanting to point to the actual class.
It's silly mistakes like these that hold me back. Just like in math, I'd always forget a plus/minus sign somewhere.... LOL
Cheers for everyone's replies though!
Mike
At 5/26/12 10:24 PM, caseymacneil wrote: are you initializing the variables?
Yeah I'm initializing them. I just cut back most of those classes since they're rearing on a couple hundred lines a piece now :P
The problem is, when I initialize the Player class, the NPC constructor gets called (naturally, since it IS the parent class to Player), yet the trace() statement I had placed in the Player constructor does not get called. I'm thinking it has something to do with how I linked it in the library. I put the movieclip's linked class as Player, and it's linked sub-class as NPC, not the usual flash.display.MovieClip.
Argh... The subtleties of AS3 OOP :P
Hello, fellow Newgrounders. I was hoping someone would be able to help me with a current issue in my game development.
So, basically, I have two classes. NPC and Player. NPC is a generic class that holds functions that in-game players and enemies can both use, but for player and AI-controlled purposes, can allow me to make seperate classes. First, a little bit of code for example:
public class NPC extends MovieClip
{
public function NPC():void
{
trace("NPC::NPC()");
init();
}
public function init():void
{
trace("NPC::init()");
}
public function main():void
{
}
}
public class Player extends MovieClip
{
public function Player():void
{
trace("Player::Player()");
init();
}
override public function init():void
{
trace("Player::init()");
}
override public function main():void
{
}
}
A little bit of explanation. The init() function sets up any variables and settings for the class when it is first created, while the main() function is run every frame in a root EnterFrame listener. The Player class is supposed to override the init() and main() functions from the NPC class.
The trace() functions are there just to demonstrate what scope and what function is being called. My main "Player" movieclip is linked to the Player class and sub-class NPC. The player is created as an object in my Document class and is handled there as such.
Anyways, my problem is that the NPC (parent) class constructor is being called, which then calls the init() function. The Player (child) class constructor is not called at all upon declaration. Any thoughts?
tl;dr child class constructor isn't called but the parent class constructor is. I just gave some code examples and explanations for further insight.
I really do appreciate any help or comments you guys can leave. Thanks for anything/everything!
Mike
At 5/13/12 10:50 AM, everette00 wrote: Lord have mercy on my mistakes. I meant to say "The choice is yours though."
That Jesus. Cool guy, I'm sure he'll forgive you lol
Thanks for the opinion :) I think I will go with SDL, just because Cairo uses really long, obscure function naming conventions (seperate every word with an _ underscore, instead of camel-case; gets to be tedious keeping code less than 80 characters per line :P) SDL also has a really nice community, and for a GDK that's flooding the market, support is everything nowadays.
I hope to show off some finish product in the coming months. Cheers, and have a great day :D
Mike
Greetings!
The name's Mike (unique username ftw), and I've been planning a game with a friend for some time now. After dabbling with Actionscript 3 and realizing it is not for us (senior AS programmer here btw), I've finally fallen back on my Ol' Faithful, C++.
Now, I've used DarkGDK in the past (which I would highly recommend), but we will be doing some multi-platform work (which is why AS3 appealed at the start).
I've been torn between two specific API's to use for this daunting project: Cairo and SDL. I've personally never used either or, and was wondering if anyone in the community can recommend one of the two (or maybe one's I haven't heard of). I am leaning towards Cairo, due to the really nice drawing capabilities it can produce, but I know not a whole lot about SDL, and it does seem to have a vastly large community that has a lot of documentation.
I would love any comments, replies, or advice you guys (or gals) can dish out!
Thanks very much! :)
Mike
You need to place
this.stop()
statements in each frame of your main player clip, since Flash will play the timeline normally. When you press a key, you can then use
player.gotoAndStop(#);
in order to specify which animation should be played for what character game state.
Thanks a lot guys! The Miner looks exactly like what I need :)
I would do timers (I was thinking about it), but once the engine reaches a more complex state, it'll be the equivalent of dumping trace() statements all over the place for debugging purposes... It gets pretty messy pretty fast haha.
Cheers, and I hope you guys will get to see me show off the first level by the end of summer!
All the best,
Mike
I'm in the beginnings of programming a game engine for a game my friend and I are working on. Everything is working fine. Don't Worry :P The only problem I have is trying to optimize it. It is somewhat choppy, and initially I thought it would be due to tearing (I read up on it in a previous post in this forum, shouldn't be hard to find). It probably isn't, since it's all script-based animation, and I was wondering if Flash (CS3) has any means to check what code is being run the most, and for how long (if anyone has used Dev-C++ and tried out their "execution speed" thingy, you'll know what I'm talking about).
tl;dr: Basically I'm trying to find out the execution speed of my code in Actionscript 3 in CS3
Thanks for any replies and help :)
- Mike
How did you code the punching bag? I really like the reactions it gets from punching it :3
Thanks, I'll look into Custom Dispatchers!
As for the predicate function, it ends up in the same outcome; It's because when submitting a script to the class, the class stores that "script" Array into an internal Array for reference - hence no updating...
If only AS3 supported pointers I could have this done in a few seconds XD
also, for the script format, index [0] is the boolean value needed to be true, index [1] is the function reference to be called, and index [2] is are the parameters that will be passed to the function when called.... thought that may be of use :/
also sorry for the double post....
Ahoy, fellow Newgrounders! I seem to have a bit of a predicament on this... Maybe you can help?
I'm working on an event engine, something that allows a developer to add a list of boolean values and function references, so that if the boolean is true, it will call said function, and then wait for the next boolean in sequence to be called before moving on...
Some sample code as follows:
var script:Array = [
[n > 3, trace, "trace function called"]
];
It uses a script format that passes to a class which will parse these and call functions. As you can see, the boolean is (n > 3), where n is a variable on the main timeline. I'm having a bit of difficulty where the (n > 3) gets converted into a boolean value as soon as the swf loads, and then won't update to keep checking for the boolean.
I have found one solution to this, and that is to pass the script over to the class in an ENTER_FRAME method, so that it keeps getting updated that way. I find this a bit messy,and would prefer to do all of the "updating" under-the-hood inside of the class, so when reusing this class it will take minimal work and fuss to use.
Would anyone have any suggestions on how to fix this?
I'm trying to make an open-source game engine, so the quicker I get these classes done the quicker I can put this on NG :D
Thanks for anyone who is willing to help, it's always greatly appreciated!!!
-Mike
hey NG, i've been searching and browsing the entore movies section and google and still cannot find this flash animation; it's of two square-headed people fighting in a white background, and the choices of music were "hard" (let the bodies hit the floor by drowning pool), and "soft" (where is my mind? by the pixies). Any help in finding this movie is greatly appreciated :)
thanks,
-mike
Actually, I remember there being 2 versions: the original had the music by The Pixies, the author re-uploaded a new version with different music in it. Anyone have the link?
I rememberwatching a movie on Newgrounds a few years ago, but can't seem to find it. It was a frame-by-frame animation of 2 "block-headed" people (1 yellow, 1 blue) and they were fighting to the music of Where is My Mind? by The Pixies. Anyone have a link?
At 9/9/09 07:07 PM, Peaceblossom wrote: Google is unbelievably better for Linux problems than Newgrounds. I also believe that Ubuntu comes standard with a note-taking program called Tomboy which allows for tabs and Wikipedia-style linking.
I do believe I have Googled this. That is why I go to such forums for help - when Google is not.
@ Sweeper128 - I am using Tomboy atm since I can't really find anything to suite my tastes. Thanks for the post though! Conky doesn't have what I need either...
Any sticky note programs for Linux (Ubuntu) similar to the Vista notes? I like how it has a clean, visually appealing look, and also that it has tabbed notes.
-Mike
At 7/16/09 06:24 PM, BillysProgrammer wrote: Why not try there website, or use Google like the rest of us.
If you still are to lazy to do that, I want you to know that I even put the search stuff in it. Anyways, I know of a good website for learning C++ basics, try -> here
I have tried Google - none of those tutorials were useful; it was basically code you look at and it explains none of it. And if you read my post properly (which no one seems to ever do), I UNDERSTAND C++, I am trying to learn C++.NET (for creating .NET applications). Fuck.
Can anyone recommend a good online tutorial for learning C++.NET? I have a solid understanding of C++ (and I'm creating games using the DarkGDK engine) but I want to start creating some native windows applications. I also know Visual Basic so I'm comfortable working with form, form controls, etc.
Any help with the subject would be great!
-Mike
Alright thanks! Also, does this method work for using input text boxes?
For a new project I'm working on, I need a text editor - I want to "syntax-highlight" so to speak and make different parts of the text box different colours. Basically something like this:
myTextBox.substr(start, length).textColor = 0xFF0000; //or some other colour
...Except that won't work. Any idea on how to get this going?
-Mike
Hi there. I'm quite experienced in C++, but am looking into starting C++.NET so I can develop desktop applications. Does anyone have any good resources on where I should start?
Thanks for any help,
-Mike
At 1/25/09 05:38 PM, VigilanteNighthawk wrote: But what if the OP wants to just make a game in a reasonable time frame? It is true that learning how to work directly with raw API's is certainly great experience that will help make the games more efficient, it would be too time consuming to do a game completely from the ground up like that. Also, the OP would end up having to construct a game engine at some point to manage the complexity of the project, so if the goal is simply to create a game, then why not use the pre-existing engine?
Exactly. I want to get a nice, easy-running GDK so I can make a couple of games for my portfolio next year when appliying to University/College. I'm taking some computer science courses that will teach me about GUIs, DirectX, OpenGL, API, etc.
Could someone recommend a good game development kit using C++? Lately I've been using Dark GDK, but the lack of a community and tutorials (I know there are tutorials included, but it only covers the basics) for using the development kit aren't really helping. I was looking into XNA, but I don't feel like learning C# anytime soon. So, could someone recommend a good GDK or have any good tutorials for using Dark GDK? Thanks for any help!
-Mike
I'm making a game in VB6 for my final project in my programming class. Game is done, works well, but I've run into a little glitch. When the character dies, you get taken to a form that displays your final progress, etc. I'm using the following code:
Unload frmGame
frmGameOver.Show
I also used the same code on a pause screen that will show frmMenu instead of frmGameOver, but the code is still the same. My problem is, for some reason, frmGame dissapears, but doesn't "unload" and the background music still plays and all of the timers still work, etc when the player dies, but when exiting out of the form when using the pause menu, it works perfectly. Any idea why this won't work? Here's my code:
Player Dies Function:
' Update player's health (both number display and bar display)
Private Sub updateHealth()
' Go to the "lose" screen if player is dead
If intPlayerHealth <= 0 Then
Unload frmGame
frmGameOver.Show
Else
' Otherwise display player's current status
lblHealth.Caption = intPlayerHealth
shpHealthBar.Width = (intHealthBarOriginalSize * (intPlayerHealth / 100))
End If
End Sub
Pause Menu Exit:
' Return to the main menu when clicked and the game is paused
Private Sub imgPause_Click()
If blnPause = True Then
Unload frmGame
frmMenu.Show
End If
End Sub
See? The "unload" code is the same, but the player death function won't work.
Thanks for any help or replies and all is greatly appreciated!!! :D
-Mike

