Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.23 / 5.00 3,881 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.93 / 5.00 4,634 ViewsI mention in a previous thread thread that I need to make the shift from using hitTestObject to using math for collisions.
Well now the time has come. I'm trying to figure out how to check collision between a circle (player) and a box/rectangle.
I've spent the past 6 hours pouring over forums and online guides (most seemed concerned with circle to circle collision for some reason) trying to figure out how to check if a circle intersects with a rectangle and I'm kind of burnt out trying to wrap my head around the math of it all.
All I want to do is simply check if there is a collision - I don't need to figure out how to move them out of collision (well....not for this game anyways...).
Any input or pseudo code with be greatly appreciated...
I'm gonna get some rest and maybe I'll have better luck tomorrow with a clear mind.
At 9/12/14 06:24 AM, No-Brainer wrote: I'm looking for some work to get me back into working on animation, so anything will do.
If you are really looking for some work to get you back into working on animation then you should do it for free ;)
98% of the users won't pay for an artist. That being said most would be willing to share ad revenue - how much depends on the artists workload and type of project.
@milchreis
Wow....when I asked to get some pseudo code to help me understand things better I didn't expect anyone to go into such detail. You went above and beyond with helping me with understanding everything and for that I say thank you so much! I truly do appreciate it dude :) Never would have been able to come up with everything you just suggested on my own. Well... maybe some day down the line (far down the line) as I learn more programming. I will have to fiddle around with everything you suggested.
Up until this point I have never seen "implements" used in defining the class. I will have to go read up on it but for now I think I get the gist of it due to everything you posted.
Thanks again for all of your input it is greatly appreciated.
At 9/12/14 04:59 AM, Etherblood wrote:At 9/12/14 04:35 AM, Hero101 wrote:What I mean with buff system is a way to attach 'buffs' to your units.
Ahhh ok I see. Thank you for explaining everything so well. I fully understand everything you just told me. I think I need to start asking more questions about best practices in the future. If I didn't ask this one I would have gone on checking things too often and only with boolean until it dawned on me much later down the road how there is a better overall way of doing things.
Thanks again I truly appreciate it.
At 9/12/14 04:18 AM, Etherblood wrote:At 9/12/14 03:39 AM, Hero101 wrote: My current idea is to use booleans inside the key handlers that will check which level it is.Imagine what your code would look like if you had 100 different levels and you put all possibilities inside the key handler...
Ah yeah you bring up a good point. The game will be about 20 simple levels and only 7 of the levels have altered controls like I mentioned.
Stuff that differs between levels (like gravity, friction etc) should be defined in the levels.
Include the environment variables when deciding what exactly your character does.
That's a great idea. Guess I'm still such a newbie that it didn't even cross my mind to define it when I call the level.
If you have multiple entities which should behave differently in your level (eg reversed controls for your character but not for monsters) you might want to consider to introduce a 'buff' system, implementing a nice&clean buff system can be complex though and might be overkill
Can you expand on this notion? It probably is overkill for this game as it is so simple and short, but I would like to know for future games. What do you mean by "buff" system?
Tinkering around with a few games at the moment and one of them is a very simple platformer.
Depending on the level the character's control attributes will vary. By that I mean the player will use the same keys to move control the player (WASD or Arrows) but some levels the controls will be reversed or his speed will be greatly increased or reduced.
Wondering what would be the best way to go about organizing this.
My current idea is to use booleans inside the key handlers that will check which level it is.
I'm open to any other suggestions. Since I'm still fairly new to arrays/loops if you are going to suggest them in some way could you go a little into detail about how I would use them for this situation or give me some pseudo code demonstration.
Thanks in advance guys.
At 9/11/14 08:06 AM, Barzona wrote:At 9/11/14 05:19 AM, sharpnova wrote:
I hear that. I'm pretty much only interested in 2D styles, but I'd like to break into 2.5D in the near future. Flash isn't strong enough anymore.
There are tools like Away3D that take advantage of Flash's new Stage3D. I've looked into it and while it's cool you can now handle 3D objects in Flash I can't help but feel at that point - regardless if you are making a 3D game or 2.5D game - you might as well make the switch to Unity.
I'm just started learning AS3 since the start of the year so I'm going to stick with it for awhile but plan to eventually learn Unity in the future.
At 9/11/14 07:01 AM, pixelatedmage wrote: Made a fire effect, might add smoke and stuff later. Great for use in games and movies, highly customizable and easy to use.
What do you think?
Looks cool to me dude! It does look like something that could hit performance like milchreis mentioned. Took a gamble trusting you by downloading it so I could play around with it. Just know a lot of people are too sketched out to download something from a stranger as you never know what kind of hazard you could be opening yourself up to. I'll play around with it though and if I come up with something cool I'll share it with you.
At 9/10/14 05:46 PM, Barzona wrote: I'm interested in starting to use Unity, but I have a few questions that I would like you to be objective about.
I'm very curious myself on all of these questions. Actually earlier today I found myself pondering some of these questions. So I can't help you....but I'm commenting here so I can remember to come back to this post to see what others have to say haha
I do know that some people love using Maya with Unity. Other's 3dsMax. I don't know if one is really better than the other though - more personal preference and what your goals are to accomplish with the 3D program.
At 9/10/14 10:14 PM, Xombiehacker wrote:At 9/10/14 07:28 PM, Hero101 wrote: Who knows what will happen down the road. Time will tell. Let's hope you are right and that it doesn't get corrupted.Ok, I thought you meant a different type of hack, but I still don't understand how you could make a security flaw, to effect MVC they would either have to attack websites and alter their data, in which case it wouldn't matter if it's MVC1 or MVC2, you'd be screwed either way, or to create a virus that attacks user's local data, and something like that could easily be weeded out with any kind of decent anti-malware software, and the user would simply have to reinstall flash player. So again, I really don't think it's that big of an issue
No company wants to have their names attached to something like these scenarios. Thus they would pull the plug on it regardless of what measures each individual could do to protect themselves.
At 9/10/14 07:16 PM, Xombiehacker wrote:At 9/10/14 11:18 AM, MintPaw wrote:it would simply be easier just to keep letting MV1 work
I think you missed where he said the part about the next big security issue happens. Adobe no longer supports MV1. So if some punk ass hacker comes along with nothing better to do and finds a way to manipulate it in such a way that it is a major threat to anyone who uses it - they will not fix it since it is not support and it will be dropped. Or as MintPaw said you'd have to find some shady work around. Yes someone could still try to do the same to the current player but it is still supported so they are constantly updating/fixing it.
Who knows what will happen down the road. Time will tell. Let's hope you are right and that it doesn't get corrupted.
At 9/10/14 06:09 PM, MSGhero wrote:At 9/10/14 05:57 PM, Hero101 wrote:
It works if I drag the Player class out of the com>test folder (see pic I posted) and place it in folder with my .fla and document class. But that seems to ruin the idea of organization....
Wow the situation is worse than I thought....so much F***ing greed....
At 9/10/14 06:09 PM, MSGhero wrote:At 9/10/14 05:57 PM, Hero101 wrote:
I don't think the program sees my player class with how it is setup
This is telling the player to add himself to himself. You can't/shouldn't addChild from inside some random class, that should be done from inside the document class or something akin to that. So instead of calling player.function in your onClick, just addchild the player. Then if you want to do more things, like set the player's hp or whatever, then call player.doOtherThings() after you addchild it.
Oh yeah you are right. I left something out. I changed that addChild to a simple trace. When I test it I get the error
TypeError: Error #1006: showPlayer is not a function.
at flashbuilder_test/onPlayerBtn()
which of course it is not a function in the document class it is a function in the player class. But for some reason declaring the player class in the document class like I showed in my code isn't working.
So trying to figure out how Flash Builder works (I am on a mac). Combining it with my Flash IDE. I'm new to coding outside of the Flash IDE so I need some help.
In Flash Builder I created a new flash professional project which has me target my .fla. When I do this it creates a class of the same name (flashbuilder_test) in the same location as my .fla. Since I'm just practicing to get used to Flash Builder I went ahead and used this class it automatically created as my document class.
Now I created a new actionscript file for a Player class. With the original class it had me create it didn't give me an option to name the package - it just used a default package with no name. When I create a new class I have to give it a package name.
I named it com.test which when created puts this .as file in a different location than my document class I mentioned above.
I think because it does this (or the naming of the package) I am having trouble getting the two classes to communicate.
In the past to get my main class (document class) to communicate with player class I would simply do:
//document class
var palyer:Player;
public class GameManager extends MovieClip
{
player = new Player();
player.testTrace(); //call function in player class
}
// Player class
public function testTrace():void
{
trace ("it works");
}
This would work just fine. I can't seem to do it with the way Flash Builder set things up. Here is my code:
Document Class it generated for me when I created the project (thus the same name as my .fla)
package
{
import com.test.Player;
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class flashbuilder_test extends MovieClip
{
public var levelOne:LevelOne;
public var colorBtn:ColorBtn;
public var playerBtn:PlayerBtn;
public var player:Player;
public function flashbuilder_test()
{
levelOne = new LevelOne();
addChild(levelOne);
playerBtn = new PlayerBtn();
addChild(playerBtn)
playerBtn.x = 500;
playerBtn.y = 400;
player = new Player();
playerBtn.addEventListener(MouseEvent.CLICK, onPlayerBtn);
}
public function onPlayerBtn(e:MouseEvent):void
{
player.showPlayer();
}
}
}
And my Player Class
package com.test
{
import flash.display.MovieClip;
public class Player extends MovieClip
{
public function Player()
{
x = 100;
y = 100;
}
public function showPlayer():void
{
addChild(this);
}
}
}
Sorry for the long post I am just trying to explain myself as clear as I can with something I'm totally new to (coding in another program).
Here is a screenshot so you can see everything. My .fla file is with an .as file of same name that Flash Builder automatically made which I used for document class and com folder where it put my player class.
Thank you for all of the input guys. I love it when you all chime in to help me out with one of my questions :)
At 9/10/14 06:08 AM, milchreis wrote:At 9/10/14 05:52 AM, Hero101 wrote: I asked because I generally check things in the ENTER_FRAME with booleansThat sounds like a problem.
What are those booleans?
Why do you have to check them 30 times per second? (assuming 30fps) Do they even change that often?
I'm sorry it's late....you're right I don't generally check booleans. Just things like if (health <= 0) and such conditions in the that need to be updated in the ENTER_FRAME.
Although recently I did a test game where I used a boolean in ENTER_FRAME. The boolean was to test if the player was on fire. if set to true (player is on fire) I had it call an onFire() function. I did this as I wanted the function called 30 times a second.
function onFire():void
{
_currentHP--;
if (_currentHP <= 0)
{
_currentHP = 0;
trace ("YOU ARE DEAD!");
}
updateHealthBar();
}
I made the test game to practice with dynamic health bars. I had a button that when clicked would set the boolean to true and also start a timer. The timer was set for one second and after that it would set the boolean to false to stop the player from being on fire.
I guess instead of using the ENTER_FRAME to update the player's status I could have tied _currentHP--; to a timer instead?
Ultimately, I see your point about how I shouldn't bog my game down with too many conditions inside of the ENTER_FRAME. it's something I will have to pay more attention to in the future.
At 9/10/14 05:41 AM, milchreis wrote:At 9/10/14 05:17 AM, Hero101 wrote:Instead of asking about possible solutions, describe your problem:
What are you doing in that ENTER_FRAME? What makes you want to have a switch there?
I don't have a problem I'm just researching it right now and I was just asking in advance before I tried it myself. I asked because I generally check things in the ENTER_FRAME with booleans and was curious if switch statement could do the same. Now I know so thank you.
So I was reading through AS3 API online and I stumbled upon switch statements. After reading about switch, case, and default I think I grasp it.
This was the example code on the adobe page:
var switchExpression:int = 3;
switch (switchExpression) {
case 0:
trace(0);
break;
case 1:
trace(1);
break;
case 2:
trace(2);
break;
default:
trace("Not 0, 1, or 2");
}
// Not 0, 1, or 2
Now is doing it this way just a more clean way than having to type out a bunch of if/else statements?
Don't know if it is a stupid question....but can switch statements go inside an enter_frame handler?
At 9/10/14 04:55 AM, tanikozo1 wrote:At 9/10/14 03:33 AM, Hero101 wrote:Thanks.I use Photoshop CS5.5.At 9/8/14 01:19 PM, tanikozo1 wrote: Here's my knightThis is pretty cool. You use paint to make your pixel art or...?
Is it very time consuming to make pixel art? I honestly haven't attempted it myself, but was considering using pixel art in one of my future games.
At 9/8/14 01:19 PM, tanikozo1 wrote: Here's my knight
This is pretty cool. You use paint to make your pixel art or...?
So tonight I started tinkering around with Flash Builder (I'm on a mac). To get used to it I integrated it with a test game I made with my flash IDE that had a few classes. I decided to create a new actionscript class inside of Flash Builder and in the dialogue box it would not let me create the class without giving it a package name.
Now up until this point I have been coding inside of the Flash IDE and have never given my packages a name. I had seen people do it in tutorials and I know people here in the forums do it as I've seen it from whatever code they posted - but I never knew, or questioned, why.
Did some reading up on naming packages and naming conventions. So the main reason/benefit of naming packages is for organizational purposes correct?
tl;dr
What is the benefit of giving your packages names?
At 9/10/14 01:23 AM, MiniShowsDOTNetwork wrote: hey do you want to help me or teach me how to make a sidescroller platform game!? I have character design, control options. I just need help with action script.
There are plenty of tutorials online to help teach yourself how to code. If you'd rather just have a programmer do it for you try posting this here
At 9/8/14 09:58 PM, FuelScenes wrote: Do you have a plot idea to start with? Sort of a general direction and structure for your Visual Novel.
I think he might of phrased it the way he did because generally people that have art talent have "visual novels" in their heads they plan to create but don't know how to string them together with code. I could be wrong though.
If it is strictly a visual novel then it's about 90% work for the artist and 10% for the programmer so he may be giving the artist creative freedom.
I myself would love to make a horror point n click game after I finish up a few more games I'm working on and those types of games are about 50/50 work load for the artist and programmer.
At 9/8/14 01:46 PM, min3ralWater wrote: Hi!
I like making games or at least trying to, but my lack of programming knowledge has always kept me back from doing so, so i wondered if anyone need a little help with their project, sprite sheets, backgrounds or pretty much anything as long as its a small project and they are looking to actually get it done.
Please take a look to my channel if you wonder about the art style and pm me if you're interested.
thanks :)
Looked at your art and I have to say for your age you are really good. Thought the last art you submitted would have fit well in whatever game you were attempting.
I've only been programming since the start of the year so my games are pretty simple (check them out to see what I mean). I am hoping to work with an artist on very small projects in the future. Right now though I am just not confident enough in programming skills to team up with anyone at this point. Still have so much more to learn.
Keep up the good work dude!
At 9/8/14 11:36 AM, snickity wrote:At 8/25/14 06:51 AM, Uranium92 wrote:
if it's from dumpinggrounds it's cool. but those links are rarely seen lately
I love the dumping grounds here on NG. More people should use it to get feed back on their projects before publishing their work here on NG. I hope they keep it when the redo NG's layout.
At 9/7/14 06:52 AM, ExTincT-ArT wrote:At 9/6/14 08:23 PM, INKspireART wrote:I'm 15At 9/1/14 07:16 AM, ExTincT-ArT wrote: First ever proper art done by me i think its good since i've been learning for 3 days. Hope you like it and any advices will be taken thank you!Just curious, how old are you?
Just keep practicing and you'll only get better. You're young so you have plenty of time to grow you skill set.
If it makes you feel better I'm 28 and your art is already better than mine haha
At 9/7/14 11:13 PM, Barzona wrote:At 9/7/14 10:26 PM, MintPaw wrote: Yeah, I expect it to stay around for at least a few more years. Don't sweat it, but plan on learning AS3 for the benefit of AS3 alone.I wish I had Flash in my life ten or so years ago when AS3 came out. i feel like such a chump only getting into it over the last couple years and only coming to fairly understand it now.
Seriously...... If it makes you feel any better I only started at the beginning of the year :(
At 9/4/14 01:00 PM, RagingWarlock wrote: Do know that it is just a prototype, and not yet the final version of it!
I can't do pixel art (or any art really haha learning to program instead) so I can't help you. Out of curiosity though, what program are you guys using to make your pixel art?