kyllian1212 Posted March 8, 2014 Report Share Posted March 8, 2014 (edited) I REALLY dunno if i should post it here or in the showcase section (or somewhere else). Else mods, feel free to move this topic. ------------------------------------------------------------------------------------------------------------------------ So hm. I'm trying to do a Sonic Engine (which is actually based on the Sonic Revival Engine... An engine based on an engine, wierd) engine. I've just started doing it yesterday, so it has not much added for now. I want somehow (even though it will be hard, i know) to make the most Complete Sonic Engine possible, with both classic and modern characters and gimmicks. For now i'm working on the modern part however. Anyways here's some info about it! I've currently added: Ramps, Dash Rings, and Rainbow Rings. That is all i added for now. I modified a little bit sonic animation due to running being glitchy (Sonic goes walking then running then walking then running etc.). however now the whole animation system gliches. That's minor glitches but still. Pics! Download (Current Version): https://www.dropbox.com/s/zatmzdu3kxxtwks/SonicRE0.3.exe Credits, Version log The Sonic Revival Engine Modified I made the engine MODIFICATIONS. I didn't make the original engine at all.ENGINE CREDITS:The Sonic Revival Engine ModifiedI made the engine MODIFICATIONS. I didn't make the original engine at all.ENGINE CREDITS:TechnoSuperguy -For helping me fix many ringloss problemsDamizean -For engine baseRougeyoshi -For Sonic 3 shields + sprites + HUDAlex Z -For spritesKain -For checkpointsChaos Rush -For compiling this engineSome people that i forgot and that i used their sprites/other things. (sorry for forgetting ;_ CONTROLS:Right -Move rightLeft -Move leftDown -Look downSpace -JumpDown+Space-SpindashRight/Left+Down -RollingZ -LightdashFire Shield+Space+Space -Air DashWater Shield+Space+Space -Air BounceElectric Shield+Space+Space -Double JumpVERSION LOG | + = addition | * = changes/bugfixes | - = removal | O: = other stuff (like comments etc) |Day 1 - Version 0.1: First day, first release on Dropbox.+ Added Jump Pads + sprites+ Added Dash Rings + sprites. Not all of them are there yet.* Modified Sonic Sprite order (minor)Day 2 - Version 0.2+Added Rainbow Rings + sprites+Added a new test stage+Added sounds for all new objects i said previously (including 1st day one)* Fixed some stuff about Rainbow Rings and Dash Rings.- Removed the old test stageO: Trying to fix the sound glitch and collision glitch... fail.Day 3 - Version 0.2.5 - This one is rather minor so yeah.+Started to work on the classic part and i added a classic spring. Goes only upwards for now but i'll add more.*Started to fix the Dash Ring and Rainbow Ring collision glitch.Day 4 - Version 0.3+Continued adding classic springs. Added yellows and reds + sprites + sounds.*Dash Ring and Rainbow Ring glitch still not fixed.*Modified the test stage so it features the classic spring test. And backgrounds. Anyways, now i need help for two things for now - When collision happens with Sonic and the dash/rainbow rings, it collides every frames into it. So as result, it does an ANNOYING sound effect spam. - Sonic's animation is a bit messed up due to the modifications i made... So yeah, if anyone could help... thanks in advance ^^ Oh also excuse me for any spelling and grammar errors, i'm french so yeah (my english is more then comphrensible however, dont worry). And plus, i'm rather tired right now, so yeah. Edited March 10, 2014 by kyllian1212 Link to comment Share on other sites More sharing options...
OverbounD Posted March 8, 2014 Report Share Posted March 8, 2014 If the sound keeps starting you can use sound_is_playing to check if a sound is already playing. If it is then simply do not play the sound again. A better method might be to use a variable that changes values when you hit a wall. collision event: if collision == false { sound_play(sound); collision = true; } step event: // checks if if place_meeting(x, y, objWall) { collision = false; } This will sort of work but the trouble is it will detect floors too, assuming they are the same objects. In which case you will want to look into bbox boundaries and check for collisions against those. But you will need the ID of the wall you are touching to do that. Do you know if your engine gives you the instance id for the current wall you are touching? Link to comment Share on other sites More sharing options...
kyllian1212 Posted March 8, 2014 Author Report Share Posted March 8, 2014 (edited) Well i would like the sound to play once per object, since it also basically hits it every frames. Actually i don't think the sound is the problem. The collision is, rather. But for now, i attempted something with the sound: if not sound_isplaying(sndDashRing) sound_play(sndDashRing) else ?? Except i dunno what to put to make it play the sound once per object. But since it's a collision problem, i guess fixing the collision in priority (so it hits the object just once per collision) and will also fix the sound problem. Also, i guess it gives me the instance id in the room menu, not directly in game. Else i could PM you the GMK if that can help? I use Game Maker 8, however. Edited March 8, 2014 by kyllian1212 Link to comment Share on other sites More sharing options...
VectorSatyr Posted March 8, 2014 Report Share Posted March 8, 2014 (edited) Basic pseudo code: var collision; var last_collision; on begin step event: last_collision = collision; collision = false; on collision event: collision = true; if collision and not last_collision just collided; perform stuff on end step event: if not collision and last_collision stopped colliding; perform stuff Edited March 8, 2014 by VectorSatyr Link to comment Share on other sites More sharing options...
kyllian1212 Posted March 8, 2014 Author Report Share Posted March 8, 2014 (edited) Dunno if what i did is correct, but i get this: ___________________________________________ERROR inaction number 4of Begin Step Eventfor object objSonic:Error in code at line 4: last_collision = collision; ^at position 19: Unknown variable collision___________________________________________ERROR inaction number 8of End Step Eventfor object objSonic:Error in code at line 4: if not collision and last_collision; ^at position 9: Unknown variable collision Should i send the GMK or something? Edited March 8, 2014 by kyllian1212 Link to comment Share on other sites More sharing options...
VectorSatyr Posted March 8, 2014 Report Share Posted March 8, 2014 It's psuedo-code, not actual code. You're supposed to write your own code using the same logic. (You're probably using var literally; var is just for temporary variables, they go out of scope at the end of the code block) Link to comment Share on other sites More sharing options...
kyllian1212 Posted March 9, 2014 Author Report Share Posted March 9, 2014 (edited) Okay, started to fix it now, i'll probably continue tommorow. Today progress: Day 3 - Version 0.2.5 - This one is rather minor so yeah.+Started to work on the classic part and i added a classic spring. Goes only upwards for now but i'll add more.*Started to fix the Dash Ring and Rainbow Ring collision glitch. EDIT: Also, once again: Am i allowed to post a sort of preview version each time i do a new version? This could help people to know what happens if there a problem. Edited March 9, 2014 by kyllian1212 Link to comment Share on other sites More sharing options...
VectorSatyr Posted March 9, 2014 Report Share Posted March 9, 2014 (edited) Nothing's stopping you. There isn't a rule against posting your build. (Just don't act surprised if people trying to help grow a bit weary of the downloads) Edited March 9, 2014 by VectorSatyr Link to comment Share on other sites More sharing options...
kyllian1212 Posted March 10, 2014 Author Report Share Posted March 10, 2014 Progress!Day 4 - Version 0.3+Continued adding classic springs. Added yellows and reds + sprites + sounds.*Dash Ring and Rainbow Ring glitch still not fixed.*Modified the test stage so it features the classic spring test. And backgrounds. Since i guess i'm allowed to post a download, here's an EXE: https://www.dropbox.com/s/zatmzdu3kxxtwks/SonicRE0.3.exe Don't expect anything huge however. It just features a test stage. Link to comment Share on other sites More sharing options...
deathbob Posted May 25, 2014 Report Share Posted May 25, 2014 (edited) What I'd do for the rainbow rings is have a variable that sets weather sonic triggers the sound effect or not. In this case, I'm going to call the variable "affected" If you were to use GML for this, I'd put something like this in the collision with Sonic event of the Ring. It will replace the current sound playing script that you have, or else it will stay screwy. if affected=0 { audio_play_sound(ringsound, 10, false) affected=1 alarm[0]=15 } How this works: If the affected variable is equal to 0 it will play a sound and set affected to 1. This way the sound will no longer play EVER AGAIN (until the variable affected is set back to 0.) This is where the alarm[0]=15 thing comes in. if your room is at the speed of 30, then 15 will be have a second in game time. Replace alarm 0 with any alarm you haven't used yet. You may have to fiddle a bit with your alarm time in order to get the sound glitchless. Create a event for the alarm that you put in (in my example, 0) and give it a single piece of code: affected=0 This resets the variable, so you can play another sound when you come into contact but it will make no annoying overlap. If you meant that you wanted to set all rings to not play any sounds, replace all the times you put affected with ringobject.affected. This will set all ring objects affected variables to 0. I recommend trying both methods and seeing which one you prefer. Kind of a dumb workaround but it works. Edited May 25, 2014 by deathbob Link to comment Share on other sites More sharing options...
Recommended Posts