Recent posts by dannyboyII on Kongregate

Flag Post

Topic: Game Programming / [SOLVED-shoulda read the instructions]AS3 Extremely confusing problem with straightforward rotation

Oh wow, I guess I should try reading the instructions. What with the “Values outside this range are added to or subtracted from 360 to obtain a value within the range.” part it had me thinking it was a standard 359.

Ta for the reply.

 
Flag Post

Topic: Game Programming / [SOLVED-shoulda read the instructions]AS3 Extremely confusing problem with straightforward rotation

I have some vector graphic zombies, top down, they move left/right/up/down.
I did have 4 different sprites for l/r/u/d, which worked fine…but makes little sense, so I’ve rewritten the code to use zombie.rotation.

The extreme confusion was when they ceased to move upwards. No bugs, no freezing, no stopping doing other things (they still fight fine etc)…they just couldn’t move up. A lot of trial & error bought me to the conclusion that, although ‘if zombie.rotation==180’, works fine…as does ==90 and 0...'if (zombie.rotation270)’, turned up FALSE, even while definitely (if nothing else, I can SEE them facing up in game) zombie.rotation should have been 270.

I’ve changed the code to not need to check if zombie.rotation==270, but REALLY want to know what’s up….FYI, rotation is only ever 0/90/180/270, there’s no way I’m confusing 269 with 270 or whatever, it only goes at right angles….changing the sprite TO 270 rotation works fine, just can’t use it in an if.

This code does not work(for going up, the other directions are fine):

if (zombie.rotation==90){
y+=1;
}
if (zombie.rotation==270){
y-=1;
}
if (zombie.rotation==180){
x-=1;
}
if (zombie.rotation==0){
x+=1;
}

This code works fine:

if (zombie.rotation==90){
y+=1;
}else {
if (zombie.rotation==180){
x-=1;
}else{
if (zombie.rotation==0){
x+=1;
} else {
y-=1;
}
}
}

What the frog?

 
Flag Post

Topic: GemCraft Labyrinth / Field A11

Play with ‘armoured only’. More XP, and actually makes it easier (just make one powerful gem).

 
Flag Post

Topic: Game Programming / unsolved [AS3] Sound not working, very basic.

@Epic, aye I did.

 
Flag Post

Topic: Game Programming / unsolved [AS3] Sound not working, very basic.

Should have figured to try that one myself…..well, no errors now, the game just doesn’t load at all any more….swf just displays blank screen.

 
Flag Post

Topic: Game Programming / unsolved [AS3] Sound not working, very basic.

Ta very much, but still getting
“Warning: return value for function ‘soundComplete’ has no type declaration.”

 
Flag Post

Topic: Game Programming / unsolved [AS3] Sound not working, very basic.

“Implicit coercion of a value of type int to an unrelated type flash.media:SoundTransform.
soundTransform=1;” Error
and
“Warning: return value for function ‘soundComplete’ has no type declaration.”

 
Flag Post

Topic: Game Programming / unsolved [AS3] Sound not working, very basic.

I’m just trying to add some background music to my game, I call tell from the change in filesize that the sound is added to the swf, and the rest of the game works fine, but….silence.
Relevant code is:
public function Main() {
var tf:SoundTransform;
tf = new SoundTransform(1, 0); // volume, pan
[Embed(source=‘obj/bkgd01.mp3’)]
var music:Class;
var background:Sound;
background=new music();
var musicchannel:SoundChannel;
musicchannel=background.play(0,99999,tf);

 
Flag Post

Topic: Game Programming / [AS3] Popup info on mouse hover.

I’m trying to have popup info display when you hover over an enemy, showing health, speed, etc…
I’ve tried adding this code to the enemies, and it causes them not to spawn at all.

e1.addEventListener(MouseEvent.ROLL_OVER,disptim);
function disptim(evt:MouseEvent):void {
var dtim:Timer = new Timer(250,1);
dtim.addEventListener(TimerEvent.TIMER, display);
dtim.start();
function display(evt:TimerEvent):void {
//dtim.removeEventListener(TimerEvent.TIMER, display);
displaying=1;
HPdisp.text=“HP:” +String(e1HP) +" of " +String(e1MHP)
HPdisp.setTextFormat(XPFormat);
addChild(HPdisp)
addChild(classdisp)
addChild(damagedisp)
addChild(armourdisp)
addChild(dodgedisp)
addChild(rangedisp)
addChild(attackspeeddisp)
addChild(speeddisp)
addChild(regentimedisp)
}
}
e1.addEventListener(MouseEvent.ROLL_OUT,dispoff);
function dispoff(evt:MouseEvent):void {
if (displaying==1) {
displaying=0;
removeChild(HPdisp)
removeChild(classdisp)
removeChild(damagedisp)
removeChild(armourdisp)
removeChild(dodgedisp)
removeChild(rangedisp)
removeChild(attackspeeddisp)
removeChild(speeddisp)
removeChild(regentimedisp)
}
}

the dtim timer is so it’s on mouse hover, not 20 popping up every time you move the mouse around.

Can anyone see what’s wrong, or know a good way to do this?

 
Flag Post

Topic: Game Programming / [AS3] Anyone see anything wrong with this KeyboardEvent code?

Thanks for the replies, but on loading it up today, it works fine already. Mystery…

 
Flag Post

Topic: Game Programming / [AS3] Anyone see anything wrong with this KeyboardEvent code?

stage.addEventListener(KeyboardEvent.KEY_DOWN, key);
function key(event:KeyboardEvent):void{
if (event.keyCode == 39) {
glob.vars.rightkeypres=1;
}
if (event.keyCode == 38) {
glob.vars.upkeypres=1;
}
if (event.keyCode == 37) {
glob.vars.leftkeypres=1;
}
if (event.keyCode == 40) {
glob.vars.downkeypres=1;
}
}

I’ve checked that what I need to read glob.vars.blahkeypres=? can read it correctly, but this bit to detect when a key is pressed doesn’t work. No error messages, just pressing keys has no effect, the vars aren’t changed to 1.

 
Flag Post

Topic: Game Programming / AS3 Sprite.graphics making sprite.x twice as big problem.

Ya mean x=0 in name.graphics.drawblah is automatically set to name.x? Why didn’t I think of that…..ah well, thanks for the quick reply :)

 
Flag Post

Topic: Game Programming / AS3 Sprite.graphics making sprite.x twice as big problem.

Relatively new to actionscript, just trying to put something simple together and I keep running into a problem that I can’t find anything about via searching.

when using name.graphics.drawwhatever, where ‘name’ is a sprite, and using name.x &/or name.y to tell it where to draw, it interprets name.x/name.y as being twice what they are.

For example,

name.x=80;
name.y=60;
name.graphics.drawRect(name.x,name.y,14,50);

It actually draws it at 160, 120.

if name.graphics.drawRect(name.x*2,name.y+10,14,50)

it draws it at 320,130.

countless other examples, it’s consistent in everything I do…but I can’t see the problem. Help? :/

One thing to mention…I have tried workaround by simply replacing all name.xs with (name.x/2)…..in which case it works perfectly, and gives me 80/2=40…

 
Flag Post

Topic: Technical Support / No Badge, no screenshot

It’s the second time it’s happened…and I’ve not been here long, but other time it did give me the hard badge for winning game, just not easy for killing X amount of enemies, even though I must have to win game…so admins/whoever gave it me in the end.

Oh well, thanks for the replies…..

 
Flag Post

Topic: Technical Support / No Badge, no screenshot

I figured as much…..but, then what? do we constantly take screenshots of badge games as we play just in case?

 
Flag Post

Topic: Technical Support / No Badge, no screenshot

I didn’t take a screenshot because I didn’t know I wasn’t going to get the badge….and now it’s just the main menu again.

It’s storm the house 3 alamo badge, took ages, was boring….don’t wanna have to do it all again just to take a screenshot.

wat do?

Even if ya don’t believe me/want to give me it, what’s the advice in this situation? people aren’t likely to take screenshots until after the badge fails to be given, by which time there’s nothing to screenshot…..

 
Flag Post

Topic: Kongregate / Suggestions

No idea if the adminds read this thread with 264 pages, but suggest change/addition to the rules: icon and description of a game should accurately represent it, no false advertising.

 
Flag Post

Topic: Kongregate / Gavain788 - Developer Troll

None of his ‘games’ are actually games, he isn’t someone who is bad/new at making games, he is someone who is submitting many (13 in 8 days) completely useless swfs with misleading descriptions.

 
Flag Post

Topic: Kongregate / Gavain788 - Developer Troll

I know my game is very very basic, but not like his. Have you seen his? he has one called ‘waste your life’, where you click a button. Each click makes the ‘life wasted’ score increase by one. That’s the whole game…..his latest submission has a description starting “15 years of work to this epic game, it is an rpg cyber twist fantasy”.

Now go ‘play’ it.

He’s either trolling, or just trying to make money submitting nothingness swfs with interesting descriptions.

If it walks like a duck…

 
Flag Post

Topic: Kongregate / Gavain788 - Developer Troll

Example for people unfamiliar with his work.

http://www.kongregate.com/games/Gavain788/back-in-time

 
Flag Post

Topic: Kongregate / Gavain788 - Developer Troll

All of his games that I’ve ‘played’ seem to be made intentionally badly, I’m sure he’s just trying to waste peoples time. Can the mods do something about it?

 
Flag Post

Topic: Game Programming / Clueless. Question.

I am in the process of learning actionscript myself, although I’ve done a little programming before…..I advise ya to learn by doing, I’m using flashdevelop with the free flex SDK; no 30 day limits, no fees to pay :) Just get those set up and start experimenting, there are plenty of flash game making tutorials out there that give example code you can play with. www.mrsunstudios.com is a good one.